Forums

Headless Chrome Activation?

Hi pythonanywhere staff,

Similar to 'https://www.pythonanywhere.com/forums/topic/26688/'), could my account be switched to the new virtualization system headless chrome support for selenium? I'm just toying with a simple idea using selenium but the target page seems to want something more modern than firefox 17.

Sure, that's enabled for your account now. To use Chrome, the next step is to upgrade Selenium for your account -- for example, if you're using Python 3.7, run this in Bash:

pip3.7 install --user --upgrade selenium

...and then you can run Selenium with Chrome using code like this:

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_options)

try:
    browser.get("https://www.google.com")
    print("Page title was '{}'".format(browser.title))

finally:
    browser.quit()

Awesome. This worked just fine for me and it seems to be running smoothly. Thanks for your timely support!

Can my account be activated too?

Ok. I have enabled it for your account. New consoles will use the new system and your web app will use it when you have reloaded it.

Hello, can my account be activated too? I have been trying to run selenium but I cannot find a solution to make it work. Thank you.

Sure, I have enabled it for your account. New consoles will use the new system and your web app will use it when you have reloaded it.