硒不从事靴子覆盆子Pi
因此,我有一个小的以下脚本:
from selenium import webdriver
import time
time.sleep(60)
with open('readme.txt', 'w') as f:
f.write('Create a new text file!')
driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver")
driver.get("https://mediamere.com")
问题是它创建一个文件,但没有打开网页。该脚本在我的crontab文件中使用此行调用:
@reboot python/home/pi/test.py.py
有人知道为什么我的网页不打开吗? 奇怪的是,如果我自己使用python/home/pi/test.py
(在启动系统后),它的工作正常
So I have the small following script:
from selenium import webdriver
import time
time.sleep(60)
with open('readme.txt', 'w') as f:
f.write('Create a new text file!')
driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver")
driver.get("https://mediamere.com")
The issue is that it creates a file, but doesn't open the web page. The script is called using this line in my crontab file:
@reboot python /home/pi/test.py
Does anybody know why my web page is not opening?
What's also weird is that if I call it myself using python /home/pi/test.py
(after the system is booted) it works fine
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您只将Web Driver传递给该功能。您需要通过.exe-file。也许尝试绝对的道路。
It seem you passed no webdriver to the function just the path. You need to pass the .exe-file. And maybe try the absolute path.