Hi - I'm trying to use selenium in my PythonAnywhere account and am running into issues with webdrivers. I just updated to the most recent version of selenium (4.1.0) and am using Python 3.8.
Using Chrome, as described here, find_elements returns a dict rather than WebElement, which seems to be an issue related to the installed chromedriver.
from selenium import webdriver
from selenium.webdriver.common.by import By
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://pr.nba.com/")
print(browser.find_elements(By.CLASS_NAME, 'archive__article-link'))
finally:
browser.quit()
Using Firefox, I get the following error, though I understand the installed version of geckodriver is quite old:
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
The Firefox issue I ran into on my local machine which was solved by installing a geckodriver on a local directory, but I don't know if I can do that in PythonAnywhere.