fix(person): normalize URL trailing slash to prevent urljoin path loss#282
Open
dtateks wants to merge 1 commit intojoeyism:masterfrom
Open
fix(person): normalize URL trailing slash to prevent urljoin path loss#282dtateks wants to merge 1 commit intojoeyism:masterfrom
dtateks wants to merge 1 commit intojoeyism:masterfrom
Conversation
urljoin('https://linkedin.com/in/user', 'details/patents/') drops the
username segment because urljoin treats the last path component without
trailing slash as a file. This caused 404s on all detail page navigations
(accomplishments, education, interests, contacts) when the input URL
lacked a trailing slash.
Fix: ensure linkedin_url always ends with '/' at the start of scrape().
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.
Summary
urljoin()drops the username path segment when the input URL lacks a trailing slash, causing 404 errors on all detail page navigationslinkedin_urlto always end with/at the start ofPersonScraper.scrape()Problem
This affects all fallback navigations in
PersonScraper:details/experiencedetails/educationdetails/interests/details/{certifications,honors,patents,...}/(8 accomplishment sections)overlay/contact-info/Fix
4-line change at the top of
scrape():All downstream
urljoin(base_url, ...)calls then produce correct URLs.Testing