尝试在带有镀铬python的树莓派上使用硒

时间:2018-09-08 17:23:37

标签: python raspberry-pi selenium-chromedriver

我正在尝试在连接到我的Arlo相机显示器的树莓派上使用硒,但是该代码在树莓派上不起作用。尽管我已经在Windows机器上测试了代码,但仍在工作。我可以在树莓派上运行chrome驱动程序,但是当我尝试配置chromeoption时会出现问题。我收到了我无法理解的错误。这是代码:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

driver = webdriver.Chrome('/usr/lib/chromium-browser/chromedriver') 
#driver = webdriver.Chrome(chromedriver)

chrome_options = Options()
prefs = {
    "profile.default_content_setting_values.plugins": 1,
    "profile.content_settings.plugin_whitelist-flash-player": 1,
    "profile.content_settings.exceptions.plugins.*,*.per_resource.adobe-flash-player": 1,
    "PluginsAllowedForUrls": "https://arlo.netgear.com/#/login"

    }
chrome_options.add_experimental_option("prefs", prefs)
chrome_options.add_argument("--kiosk") # full screen


self.driver = webdriver.Chrome(chrome_options=chrome_options)
driver.get('https://arlo.netgear.com/#/login')
'''
my username and password for accessing arlo website
'''
username = driver.find_element_by_id('userId')
password = driver.find_element_by_id('password')
username.send_keys('enter your user name here')
password.send_keys('password ')

driver.find_element_by_id('loginButton').click()

这是错误追踪:

 =================== RESTART: /home/pi/arloOpner/chrome.py ===================
Traceback (most recent call last):
  File "/home/pi/arloOpner/chrome.py", line 20, in <module>
    self.driver = webdriver.Chrome(chrome_options=chrome_options)
  File "/home/pi/.local/lib/python3.5/site-packages/selenium/webdriver/chrome/webdriver.py", line 68, in __init__
    self.service.start()
  File "/home/pi/.local/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 76, in start
    stdin=PIPE)
  File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1282, in _execute_child
    raise child_exception_type(errno_num, err_msg)
OSError: [Errno 8] Exec format error
>>> 

0 个答案:

没有答案