Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed issue where requesting through s throws an error #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AL-Hareth
Copy link

@AL-Hareth AL-Hareth commented Sep 11, 2023

the problem previously was that you were passing session as a named variable with the wrong name like this:

s = cloudscraper.create_scraper(session=s)

but if we look at the signature of the create_scraper function we find that it looks like this

def create_scraper(
    sess: Unknown | None = None,
    **kwargs: Unknown
) -> CloudScraper

so to fix this problem we can either pass the session anonymously like what i did in the pull request or we can use the proper name of the argument

s = cloudscraper.create_scraper(s)

or

s = cloudscraper.create_scraper(sess=s)

And I renamed the variable just to keep the old variable because mutating it can be bad in some cases

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.

None yet

1 participant