-1

I have Python script for web-scraping. I am running it using papermill and then I created a batch file that I use on task scheduler to run. This workflow was running fine until my virtual machine got updated. I am able to successfully run it manually or "Run only when user is logged on" without any error.

When the option Run whether user is logged on or not is selected, It just hangs at a step where it needs to open a browser to log in and then after 20-30 mintutes, It gives me time-out session error as below:

SessionNotCreatedException: Message: session not created from timeout: Timed out receiving message from renderer: 600.000 (Session info: chrome=93.0.4577.82) 

Things I have tried:

  • I have checked the box "Run with Highest Privileges"
  • I have checked the version of chrome version and everything is up-to-date
  • Start in option is added already
  • Start only if the network connection is available has "Any Connection"
  • Trigger has the Enabled option checked

This is how my .bat file looks like:

@echo off SET LOGFILE=C:\path\logs\log-%date%.txt echo on call :logit >>%LOGFILE% exit /b 0 :logit echo "Activate the anaconda prompt for the remaining commands." echo "Note that the ProgramData folder is a hidden item." call C:\path\Scripts\activate.bat echo "Change directory at anaconda prompt to application location." cd C:\path echo "Run the Python application" python papermill.py echo "Use taskkill to end the geckodriver.exe task." taskkill /im geckodriver.exe /f exit echo "Close the command prompt." @timeout 6 >nul 

Please suggest as I have tried

0

1 Answer 1

0

I had the latest chrome version 93.0.4577.82 and after few days later it was again updated to 94. My automated selenium script was not able to launch chrome browser and it just used hang at this step.

I then was able to resolve the issue by downgrading the chrome version as well as the chrome driver version. With version 92.4515.107 version, task scheduler works with checkbox 'Run whether user is logged on or not'. This also means that certain chrome version is not compatible to run using Task scheduler to run the job with checkbox 'Run whether user is logged on or not'.

I also stopped the automatic update to my chrome by changing the name of chrome in my VM avoid the further error.

This is how my current version looks like: enter image description here

I downloaded the same version chrome driver from here

2
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. Commented Sep 27, 2021 at 23:07
  • I have tried to make it more clear. Commented Sep 28, 2021 at 13:49

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.