java -jar selenium-server-standalone-2.45.0.jar -trustAllSSLCertificates
的Python代码开始客户是
from selenium import webdriver driver = webdriver.Remote('http://127.0.0.1:4444/wd/hub', desired_capabilities={'browserName':'htmlunit', 'platform':'ANY', 'setThrowExceptionOnScriptError':False, 'javascriptEnabled':True, 'acceptSslCerts':True}) driver.get('https://testvip08.mserv.local')
开始硒独立的Web服务器并获得以下错误
11:36:10.832 ERROR - runtimeError: message=[The data necessary to complete this operation is not yet available.] sourceName=[ https://testvip08.mserv.local/scripts/jquery-1.3.2.min.js] line=[19] lineSo urce=[null] lineOffset=[0] 11:36:10.848 ERROR - runtimeError: message=[The data necessary to complete this operation is not yet available.] sourceName=[ https://testvip08.mserv.local/scripts/jquery-1.3.2.min.js] line=[19] lineSo urce=[null] lineOffset=[0] 11:36:10.864 ERROR - runtimeError: message=[The data necessary to complete this operation is not yet available.] sourceName=[ https://testvip08.mserv.local/scripts/jquery-1.3.2.min.js] line=[19] lineSo urce=[null] lineOffset=[0] 11:36:11.442 WARN - Automation server can't create object for 'EUTrace.EUTracer'. 11:36:11.442 ERROR - runtimeError: message=[Automation server can't create object for 'EUTrace.EUTra cer'.] sourceName=[ https://testvip08.mserv.local/scripts/SWLogger.js] line=[75] lineSource=[null] li neOffset=[0]
Makin g javascriptEnabled:False
也不起作用。还试图打开日志关闭
logging.getLogger('com.gargoylesoftware.htmlunit').setLevel(0) logging.getLogger('org.apache.http').setLevel(0)
无上述工作。
需要更多细节?任何细节? – Ayush
最好提供URL,以便其他人可以将HtmlUnit行为与真实浏览器进行比较。 –
这是一个本地服务器,所以这个URL不适合你! – Ayush