Giter Club home page Giter Club logo

Comments (5)

thp avatar thp commented on July 17, 2024

Seems like this is a pyppeteer error:

pyppeteer.errors.BrowserError: Browser closed unexpectedly:

Is there any other information printed somewhere?

Also, pyppeteer seems to be deprecated again, just to be replaced by playwright-python (we previously used a different library for browser jobs). Seems like maintaining a testing framework that hooks into a browser engine is something nobody wants to maintain?

In any case, can you check if running a simple Pyppeteer example works? (taken from the Pyppeteer README)

import asyncio
from pyppeteer import launch

async def main():
    browser = await launch()
    page = await browser.newPage()
    await page.goto('https://example.com')
    await page.screenshot({'path': 'example.png'})
    await browser.close()

asyncio.get_event_loop().run_until_complete(main())

If this doesn't work either, it might be due to your Pyppeteer installation, if this DOES work, we should investigate more what the issue could be.

from urlwatch.

bokkabonga avatar bokkabonga commented on July 17, 2024

Sadly this didn´t work either:

Traceback (most recent call last):
File "./test.py", line 11, in
asyncio.get_event_loop().run_until_complete(main())
File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "./test.py", line 5, in main
browser = await launch()
File "/usr/local/lib/python3.6/site-packages/pyppeteer/launcher.py", line 307, in launch
return await Launcher(options, **kwargs).launch()
File "/usr/local/lib/python3.6/site-packages/pyppeteer/launcher.py", line 168, in launch
self.browserWSEndpoint = get_ws_endpoint(self.url)
File "/usr/local/lib/python3.6/site-packages/pyppeteer/launcher.py", line 227, in get_ws_endpoint
raise BrowserError('Browser closed unexpectedly:\n')
pyppeteer.errors.BrowserError: Browser closed unexpectedly:

Edit: Just noticed that pyppeteer was installed in Version 0.2.6 which is not the latest. I will see if I can update and if it changes anything

from urlwatch.

bokkabonga avatar bokkabonga commented on July 17, 2024

Sadly 0.2.6 is the newest version i can install via pip. Installing via "pip install -U git+https://github.com/pyppeteer/pyppeteer@dev" sadly fails.

from urlwatch.

trevorshannon avatar trevorshannon commented on July 17, 2024

I just did my first Browser job, and I got a similar error (Browser closed unexpectedly). Installing other dependencies and passing --no-sandbox to the pyppeteer launcher helped me resolve the issue. See:

Putting this here in case it helps anyone else!

from urlwatch.

bokkabonga avatar bokkabonga commented on July 17, 2024

I just did my first Browser job, and I got a similar error (Browser closed unexpectedly). Installing other dependencies and passing --no-sandbox to the pyppeteer launcher helped me resolve the issue. See:

* https://stackoverflow.com/questions/61780476/pyppeteer-browser-closed-unexpectedly-in-aws-lambda/62305560#62305560

* https://stackoverflow.com/questions/57217924/pyppeteer-errors-browsererror-browser-closed-unexpectedly/71935536#71935536

Putting this here in case it helps anyone else!

The first link you provided fixed my error. In my case i had to install "libXScrnSaver.x86_64". Browser jobs now run without a problem. They don´t return what i wanted them to, but they work :D

from urlwatch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.