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

[BUG] AttributeError: 'BrowserContext' object has no attribute 'new_context' when persistent_context=True #75

Open
Nongzhsh opened this issue Dec 1, 2024 · 0 comments

Comments

@Nongzhsh
Copy link

Nongzhsh commented Dec 1, 2024

Description:

When persistent_context=True in the BrowserSession, the following error occurs:

/.venv/lib/python3.11/site-packages/hrequests/browser/firefox.py", line 25, in _start_context
    return await browser.new_context(ignore_https_errors=not self.verify)
                 ^^^^^^^^^^^^^^^^^^^
AttributeError: 'BrowserContext' object has no attribute 'new_context'

Code snippet:

def bug_report():
    page = hrequests.BrowserSession(
        persistent_context=True,
        user_data_dir='./.temp/user_data_dir',
    )
    page.goto('https://www.google.com/')

Environment:

  • Python Version: 3.11
  • hrequests Version: 0.9.2
  • OS: WSL2 (Ubuntu 22.04.4 LTS)
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

No branches or pull requests

1 participant