[Lustery] fix Cloudflare CDP scraping (#2838) - #2839
Open
HornyQT wants to merge 2 commits into
Open
Conversation
Collaborator
|
Was this issue not resolved by 9ad6f17 ? I'd really rather avoid making more scrapers depend on CDP since it's a common stumbling block for users |
Contributor
Author
|
I tried this and it did not work for me. Even when i use a "webbrowser" user agent i get the same 403 error. |
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.
Lustery is now behind Cloudflare's bot-challenge and as such useCDP is required to reach the site.
That in turn brakes the old scrapeJson, since Chrome wraps a direct navigation to a JSON endpoint in a bare
<pre>tag rather than leaving it as a raw document, and scrapeJson needs the fetched body itself to be valid JSON.Converted to scrapeXPath: selectors grab that
<pre>element and JSON.parse() it in a javascript postProcess step, which also handles unicode/escape unescaping correctly for free.Also:
Note: When a scene has multiple couples the scraper can only add the first couple, second couple gets added as an URL so that it doesn't get overlooked.