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

Is this a bug ? AttributeError: 'HTMLSession' object has no attribute '_BaseSession__browser_args' #525

Open
MajorLayzor opened this issue Oct 1, 2022 · 0 comments

Comments

@MajorLayzor
Copy link

MajorLayzor commented Oct 1, 2022

My Code:

def scrape (session):
    a= r.get("a.com")
    a.html.render(script=    '''
       () => {return 'Hello World'}
''', reload=False)

It seems like passing a browser session that has been pickled before causes this error. When I instead do a fresh login and then pass the session to the function it works

File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\requests_html.py", line 586, in render
self.browser = self.session.browser # Automatically create a event loop and browser
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\requests_html.py", line 730, in browser
self._browser = self.loop.run_until_complete(super().browser)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\requests_html.py", line 714, in browser
self._browser = await pyppeteer.launch(ignoreHTTPSErrors=not(self.verify), headless=True, args=self.__browser_args)
AttributeError: 'HTMLSession' object has no attribute '_BaseSession__browser_args'

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