I have made a script based on Selenium and Chromedriver. Basically a program that login into a site. Writes a comment (From a txt file from computer) and then closes the program and no it is not a spam script but a script I have made just to begin with python and selenium.
The program itself works very well if I start it manually. Then there is no issue and chromedriver is headless since I don't need to see the whole process chrome_options.add_argument("--headless")
Then I saw a post from here Scheduling a Python Script
but the issue im having is that everytime it is the time and the program starts. It comes up the script and then a fast error which I managed to print
Which I can see there is a issue with the Chromedriver. The thing is now. How can I make this script to work through schedule tasks with Chromedriver running on the background. I might have done the setup wrong but the program works manually so I guess there might be a issue with Windows schedule tasks?
Basically I just want the script to run on the background every xx:xx time.
Please feel free to comment if needed something more information.
chrome_options = Options()
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument('--disable-notifications')
chrome_options.add_argument("--headless")
chrome_options.add_argument("--user-agent=Mozilla/5.0 (Linux; Android 6.0; HTC One M9 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36")
driver = webdriver.Chrome(chrome_options=chrome_options)
driver.implicitly_wait(5)
The driver you are using is too old and does not recognize ChromeHeadless, you need to use version 2.29 or newer:
Selenium ChromeDriver does not recognize newly compiled Headless Chromium (Python)