Tag: 金属

获取错误铬不可从docker到达

我正试图从一个python应用程序的铬上运行seleniumtesting。 这工作正常,如果我在独立的python服务器上运行。 当我创buildDocker镜像并尝试从那里执行时,我得到一个这样的错误 2017-10-03 21:18:49 – DEBUG :: Thread-1 : Error occured: Message: chrome not reachable (Driver info: chromedriver=2.32.498513 (2c63aa53b2c658de596ed550eb5267ec5967b351),platform=Linux 4.4.84-boot2docker x86_64) 。 我看到了几个关于SO的答案,这些答案build议将–no-sandbox and –disable-setuid-sandbox参数添加到chrome选项,但是当我尝试运行映像时仍然遇到该错误。 options = webdriver.ChromeOptions() options.binary_location = '/app/webdrivers/linux/32/chromedriver' #options.add_argument('headless') options.add_argument('–no-sandbox') options.add_argument("–disable-setuid-sandbox") #options.add_argument('window-size=1200×600') driver = webdriver.Chrome(chrome_options=options) 我已经安装了铬驱动程序,它的存在于我的泊坞窗应用程序文件夹中,并且我已经复制到/usr/bin和/usr/local/bin只是为了看看是否能解决我的问题。 任何帮助,高度赞赏。 谢谢 !!