Forums

Enable selenium / pyppeteer for my account.

I would like to be able to use pyppeteer with my account. My understanding is I need to make a request to be able to use chrome drivers. If I can please have this enabled and maybe an explanation on how to setup mainly pyppeteer on my account that'd be great. Right now I am trying to just run some test code with pyppeteer but I'm receiving this error.

import asyncio
from pyppeteer import launch


async def main():
  # launch chromium browser in the background
  browser = await launch({"headless" : True})
  # open a new tab in the browser
  page = await browser.newPage()
  # add URL to a new page and then open it
  await page.goto("https://www.python.org/")
  # create a screenshot of the page and save it
  await page.screenshot({"path": "python.png"})
  # close the browser
  await browser.close()

print("Starting...")
asyncio.get_event_loop().run_until_complete(main())
print("Screenshot has been taken")

Error:

pyppeteer.errors.BrowserError: Browser closed unexpectedly:

chromedriver is already installed and activated for all accounts. See https://help.pythonanywhere.com/pages/selenium/