首页新闻找找看学习计划

selenium server无法启动浏览器

0
悬赏园豆:20 [已关闭问题] 关闭于 2016-08-11 16:49

selenium server无法启动浏览器

from selenium.webdriver import Remote
import time

driver = Remote(command_executor = 'http://127.0.0.1:4444/wd/hub',
                    desired_capabilities = {"browserName": "chrome",
                                            "version": "",
                                            "platform": "ANY",
                                            "javascriptEnabled": True,
                                            }
                )

driver.get('http://www.baidu.com')
driver.find_element_by_id('kw').send_keys('xxx')
driver.find_element_by_id('su').click()
time.sleep(2)

driver.quit()

报错信息如下:

Traceback (most recent call last):   File "C:\Users\Administrator\Desktop\Python\rrts.py", line 9, in <module>     "javascriptEnabled": True,   File "D:\Program Files (x86)\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 90, in __init__     self.start_session(desired_capabilities, browser_profile)   File "D:\Program Files (x86)\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 177, in start_session     response = self.execute(Command.NEW_SESSION, capabilities)   File "D:\Program Files (x86)\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute     self.error_handler.check_response(response)   File "D:\Program Files (x86)\Python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response     raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Error forwarding the new session Empty pool of VM for setup Capabilities [{browserName=chrome, javascriptEnabled=true, version=, platform=ANY}] Stacktrace:     at org.openqa.grid.web.servlet.handler.RequestHandler.process (RequestHandler.java:115)     at org.openqa.grid.web.servlet.DriverServlet.process (DriverServlet.java:83)     at org.openqa.grid.web.servlet.DriverServlet.doPost (DriverServlet.java:67)     at javax.servlet.http.HttpServlet.service (HttpServlet.java:707)     at javax.servlet.http.HttpServlet.service (HttpServlet.java:790)     at org.seleniumhq.jetty9.servlet.ServletHolder.handle (ServletHolder.java:808)

GUY_GO的主页 GUY_GO | 初学一级 | 园豆:176
提问于:2016-08-11 16:47
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册