Python 亚马逊EC2无头刮硒,许可被拒绝
使用Python并在初始化Selenium Firefox webdriver时收到错误。我的错误陈述如下:Python 亚马逊EC2无头刮硒,许可被拒绝,python,selenium,firefox,amazon-ec2,amazon,Python,Selenium,Firefox,Amazon Ec2,Amazon,使用Python并在初始化Selenium Firefox webdriver时收到错误。我的错误陈述如下: selenium.common.exceptions.WebDriverException: Message: Failed to start browser: permission denied 背景: 我正在使用Firefox 49.0.2和Selenium 3.0.1设置一个Amazon Linux EC2实例,用于抓取。设置步骤包括: 下载Firefox和Geckodriver
selenium.common.exceptions.WebDriverException: Message: Failed to start browser: permission denied
背景:
我正在使用Firefox 49.0.2和Selenium 3.0.1设置一个Amazon Linux EC2实例,用于抓取。设置步骤包括:
/home/ec2 user
display=display(可见=0,大小=(1024768))
browser=webdriver.Firefox(可执行文件路径='/home/ec2 user/geckodriver',Firefox\u binary=FirefoxBinary('/home/ec2 user/Firefox'))
想知道是否有人可以解决“拒绝许可”问题。我在firefox目录和geckodriver文件中使用了
chmod 777
。此外,我在不同的EC2实例上执行了相同的步骤,遇到了相同的问题。您演示了如何实例化display,但是否也要启动它?(例如,display.start()
)是的,很抱歉没有包含这段代码。我正在呼叫.start()
。