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
pyppeteer Browser closed unexpectedly #442
Comments
This error usually indicates missing dependencies. Try installing |
Although Pyppeteer guys don't recommend this approach because of possible version incompatibilities, you can try the following:
Tested on Debian Buster. |
Hi Team |
I am facing this issue as well. It is a big blocker for me. |
i use Linux machine and chromium install sucessfully
when i run script so return this error
My Code:
import asyncio
from pyppeteer import launch
async def scrape_website(url):
browser = await launch()
page = await browser.newPage()
await page.goto(url)
html_content = await page.content()
# await browser.close()
return html_content
URL of the website you want to scrape
website_url = 'https://example.com/'
Run the scraping function
html_content = asyncio.get_event_loop().run_until_complete(scrape_website(website_url))
Print the HTML content
print(html_content)
Traceback (most recent call last):
File "/pythoncode/main.py", line 16, in
html_content = asyncio.get_event_loop().run_until_complete(scrape_website(website_url))
File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/pythoncode/main.py", line 5, in scrape_website
browser = await launch()
File "/usr/local/lib/python3.10/dist-packages/pyppeteer/launcher.py", line 307, in launch
return await Launcher(options, **kwargs).launch()
File "/usr/local/lib/python3.10/dist-packages/pyppeteer/launcher.py", line 168, in launch
self.browserWSEndpoint = get_ws_endpoint(self.url)
File "/usr/local/lib/python3.10/dist-packages/pyppeteer/launcher.py", line 227, in get_ws_endpoint
raise BrowserError('Browser closed unexpectedly:\n')
pyppeteer.errors.BrowserError: Browser closed unexpectedly:
The text was updated successfully, but these errors were encountered: