So for now I have just a small script with an issue that is running on my Ubuntu Windows Subsystem, but I can't make the script to run since I get a weird error beucase of geckodriver.
I have also tried the steps here, but it didn't work.
Everything is running inside my virtual environment, python 3.6, latest version of selenium and geckodriver(from their website). This will be running on a server where Firefox won't be installed so that's why I'm using geckodriver and the instalation of Firefox is out of question.
from selenium import webdriver
geckodriver = '/home/user/test_env/geckodriver'
def test():
options = webdriver.FirefoxOptions()
options.add_argument('-headless')
browser = webdriver.Firefox(executable_path=geckodriver,
firefox_options=options)
browser.get('https://www.duckduckgo.com')
browser.save_screenshot('test.png')
browser.quit()
def main():
# Try running the script
test()
if __name__ == '__main__':
main()
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities
Error from the line
webdriver.Firefox(executable_path=geckodriver, firefox_options=options)
Edit: I have installed Firefox on my machine and moved it to /usr/local/bin and gave it +x permissions and I've also moved geckodriver to /usr/local/bin but I am still getting the same error.