htmlunit无法加载jquery脚本

2024-04-16 17:39:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用命令启动selenium独立web服务器

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')

得到以下错误

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]

使javascriptEnabled:False也不起作用。也尝试过关闭

logging.getLogger('com.gargoylesoftware.htmlunit').setLevel(0) logging.getLogger('org.apache.http').setLevel(0)

以上都不管用。在


Tags: thehttpsmessageserverlocalseleniumlinejs