psf/requests-html

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

MajorLayzor opened this issue · 0 comments

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'