I would like to know why i\'m getting the following error message and how can i fix it:
Traceback (most recent call last): File \"teste.py\", line
I solved my problem. Here the code:
from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.chrome.options import Options as ChromeOptions
def connectChrome():
options = ChromeOptions()
options.add_argument("--headless")
chromeDriverPath = "/usr/bin/chromedriver"
driver = webdriver.Chrome(chromeDriverPath, chrome_options=options)
print("Chrome Headless Browser Invoked")
return driver
def connectFirefox():
options = FirefoxOptions()
options.add_argument("--headless")
driver = webdriver.Firefox(firefox_options=options)
print("Firefox Headless Browser Invoked")
return driver
def main():
#driver = connectChrome()
driver = connectFirefox()
driver.get("https://www.archlinux.org/")
print("Headless Browser closing")
driver.quit()
#------------------------------------------------------------------------#
main()