Forums

Selenium Chrome

I'm looking to run selenium on PythonAnywhere however it refuses to work - no luck with GeckoDriver either.

it seems I need permission to do this or something needs to happen to my account but I can't even figure out where to contact someone about that - any help is appreciated.

I've activated the new virtualization system for your account -- that will be in place in any new consoles that you start.

If you want to use Chrome, you'll need 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()

Thank you! It seems to be working however now I'm getting error messages about the Chrome version - it says it expects Chrome v85.

Have you installed your own version of Chromedriver or Chrome into your account? The pre-installed ones are compatible with each other, but if you're installed your own version of either, you'll have to install the matching version of the other one.

same problem with my account i want to run chrome with debugging port

As Giles siad above, you need a matching version of chrome and chromedriver.