Repository navigation
fix: don't fail the request when a page has an unparsable link URL - #2444
Merged
Merged
Conversation
vdusek
reviewed
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
enqueue_links()andextract_links()failed the whole request when any link on the page had a URL thatyarlcannot parse, e.g. a phone number written ashttp://tel:+91...(ValueError: Port out of range 0-65535), or a host that cannot be decoded, e.g.http://xn--a.com/(UnicodeErrorwhen the host is read). Such links appear on real sites, since browsers tolerate them.new URL()rejects (tryAbsoluteURL).Issues
Testing
start_enqueuetest page, like the invalid-URL link crawlee JS keeps in itsenqueueLinkstest fixture. Without the fix, theenqueue_linksandextract_linkstests of all crawlers fail withValueError.test_basicofBeautifulSoupCrawlerandParselCrawlercounts the<a>tags on that page, so its expected count goes from 3 to 4.to_absolute_url_iteratorcovering absolute, relative,mailto:, out-of-range port, unclosed IPv6 bracket and invalid IDNA host URLs.Checklist