获取URL我的代码下载图像与查询字符串的URL,如果我用PhantomJS任何东西就可以了。但铬是失败我的错误如下,我能做什么?webDriver.Chrome()不能与查询字符串
urlImage = "http://ipcamera-viewer.com/image/?p=199619_20170221_162149_7208.jpg"
driver = webdriver.Chrome()
driver.set_window_position(-10000, 0)
driver.get(urlImage) <- Error Here
imgBase64 = driver.get_screenshot_as_base64()
imgBytes = BytesIO(base64.b64decode(imgBase64))
imgBytes.seek(0)
imgData = PIL.Image.open(imgBytes)
if rotationAngle != 0: imgData = imgData.rotate(rotationAngle, expand=True)
imgData.save(pathImage)
例外:
imgBase64 = driver.get_screenshot_as_base64()
return self.execute(Command.SCREENSHOT)['value']
self.error_handler.check_response(response)
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: no such session
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.14393 x86_64)
定期URL规则的代码,我使用的代码如下
file = urllib.request.urlopen(urlImage)
imgData = PIL.Image.open(file)
我跑你的代码,它完美的罚款。我使用2.53.5硒和56.0版铬?你能否提到你的铬和硒版本。另外,你是否能够打开任何其他网站? –
我想在Mac和Windows版本在Windows中'3.0.2'和'56.0.2924.87',Mac的硒也高于'3.0',我可以告诉你,今晚如果真正想知道.. – mikezang
你可以尝试降级Firefox版本。不确定,但如果这是由于兼容性问题,可能会解决。作为一切工作正常使用Selenium 2 –