You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are instances wherein IDs or slugs are embedded in other elements and they can be built into URLs that can be "followed".
<divid="project-id">Project: eca514fc</div>
The project ID eca514fc can be extracted and can be built to a URL, for example, https://example.com/projects/eca514fc.
There should be an option to follow this URL from a decorated function.
@select(css=".project-id")defget_link(element, scraper): # <-- pass scraper objectproject_id=element.text_content().removeprefix("Project:").strip()
url=f"https://example.com/projects/{project_id}"scraper.follow_url(url) # <-- add to the URLs that will be scraped by the scraper return {"project_id": project_id}
Use case
There are instances wherein IDs or slugs are embedded in other elements and they can be built into URLs that can be "followed".
The project ID
eca514fc
can be extracted and can be built to a URL, for example,https://example.com/projects/eca514fc
.There should be an option to follow this URL from a decorated function.
Solution
Implement the proposed solution in #62
Final solution: #146
The text was updated successfully, but these errors were encountered: