🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Python aiai-scrapingautomationcrawlercrawlingcrawling-pythondatadata-extractionmcpmcp-serverplaywrightpythonscrapingselectorsstealthweb-scraperweb-scrapingweb-scraping-pythonwebscrapingxpath
Adding `urljoin` method to Adaptors and Responses
Karim shoair5f9c3980dc5c
diff --git a/scrapling/parser.py b/scrapling/parser.pyindex 169c9e7..85fd79e 100644--- a/scrapling/parser.py+++ b/scrapling/parser.py@@ -2,6 +2,7 @@ import inspectimport osimport refrom difflib import SequenceMatcher+from urllib.parse import urljoinfrom cssselect import SelectorError, SelectorSyntaxErrorfrom cssselect import parse as split_selectors@@ -243,6 +244,10 @@ class Adaptor(SelectorsGeneration):return TextHandler(separator.join([s for s in _all_strings]))+ def urljoin(self, relative_url: str) -> str:+ """Join this Adaptor's url with a relative url to form an absolute full URL."""+ return urljoin(self.url, relative_url)+@propertydef attrib(self) -> AttributesHandler:"""Get attributes of the element"""