run selenium with crontab (python)

前端 未结 4 912
小蘑菇
小蘑菇 2020-12-09 19:19

I have a python script that calls chrome via selenium with the next line.

 ff = webdriver.Chrome(\'/home/user01/webScraping/CollectAndGo/chromedriver\')
         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-09 20:14

    selenium web drivers needs X session for running script. Cron scripts normally runs with out X session. Add X session in your cron script. Like as follows: * 11 * * * export DISPLAY=:0; your script.py

提交回复
热议问题