X Tutup
Skip to content

feat: allow non-href links extract & enqueue#1781

Open
kozlice wants to merge 4 commits intoapify:masterfrom
kozlice:extract-enqueue-links-attribute
Open

feat: allow non-href links extract & enqueue#1781
kozlice wants to merge 4 commits intoapify:masterfrom
kozlice:extract-enqueue-links-attribute

Conversation

@kozlice
Copy link
Contributor

@kozlice kozlice commented Mar 6, 2026

Description

Right now href attribute is hardcoded for enqueue_links and extract_links methods.

This change would allow to:

  • grab image links
  • grab links from exotic attributes in SPA

Examples:

await context.extract_links(selector="nav ul li", attribute="data-href")
await context.enqueue_links(selector=".gallery .item img", attribute="src", label="image")

Issues

?

Testing

Covered by new tests.

Checklist

  • CI passed

Copy link
Collaborator

@vdusek vdusek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Two comments...

@vdusek vdusek requested a review from Pijukatel March 9, 2026 09:03
kozlice and others added 2 commits March 9, 2026 12:10
Copy link
Collaborator

@Pijukatel Pijukatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an optional style comment on tests


await crawler.run(requests)

first_visited = visit.call_args_list[0][0][0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup