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

Browser closed unexpectedly #552

Open
akul-goyal opened this issue Jun 21, 2023 · 2 comments
Open

Browser closed unexpectedly #552

akul-goyal opened this issue Jun 21, 2023 · 2 comments

Comments

@akul-goyal
Copy link

akul-goyal commented Jun 21, 2023

Hi, I am trying to run the following code:

from requests_html import HTMLSession
session = HTMLSession()
r = session.get('https://python.org/')
r.html.render()

and I get the following error.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home//YouTubeScrapper/venv/lib/python3.8/site-packages/requests_html.py", line 586, in render
    self.browser = self.session.browser  # Automatically create a event loop and browser
  File "/home//YouTubeScrapper/venv/lib/python3.8/site-packages/requests_html.py", line 730, in browser
    self._browser = self.loop.run_until_complete(super().browser)
  File "/home//anaconda3/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home//YouTubeScrapper/venv/lib/python3.8/site-packages/requests_html.py", line 714, in browser
    self._browser = await pyppeteer.launch(ignoreHTTPSErrors=not(self.verify), headless=True, args=self.__browser_args)
  File "/home//YouTubeScrapper/venv/lib/python3.8/site-packages/pyppeteer/launcher.py", line 307, in launch
    return await Launcher(options, **kwargs).launch()
  File "/home//YouTubeScrapper/venv/lib/python3.8/site-packages/pyppeteer/launcher.py", line 168, in launch
    self.browserWSEndpoint = get_ws_endpoint(self.url)
  File "/home//YouTubeScrapper/venv/lib/python3.8/site-packages/pyppeteer/launcher.py", line 227, in get_ws_endpoint
    raise BrowserError('Browser closed unexpectedly:\n')
pyppeteer.errors.BrowserError: Browser closed unexpectedly:

I have tried running this on multiple servers and am getting the same error.

@keisanng
Copy link

keisanng commented Jul 8, 2023

Same error here.

@ajatkj
Copy link

ajatkj commented Aug 1, 2023

This project uses pyppeteer which is uses very old version of Chromium. This is easily fixable. You can check my comment on another issue here.

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

3 participants