2015-04-23 106 views
0

我使用命令的HtmlUnit无法加载jQuery脚本

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)

无上述工作。

回答

0

需要更多细节。

您看到的错误可以安全地忽略,最近还发布了HtmlUnit 2.16,并且直接测试它会更好。

+0

需要更多细节?任何细节? – Ayush

+0

最好提供URL,以便其他人可以将HtmlUnit行为与真实浏览器进行比较。 –

+0

这是一个本地服务器,所以这个URL不适合你! – Ayush