From: jack <lil...@16...> - 2016-06-21 06:45:53
|
Program error message: EcmaError: lineNumber=[41] column=[0] lineSource=[<no source>] name=[TypeError] sourceName=[http://live3.win007.com/common2.js] message=[TypeError: Cannot read property "childNodes" from null (http://live3.win007.com/common2.js#41)] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read property "childNodes" from null (http://live3.win007.com/common2.js#41) common2.js message: function getOddsData() { oddsHttp.open("get", "vbsxml/goalBf3.xml?r=007" + Date.parse(new Date()), false); oddsHttp.setRequestHeader("User-Agent", ""); oddsHttp.send(null); var root = oddsHttp.responseXML.documentElement.childNodes[0]; ..... oddsHttp as XMLHttpRequest I suspect that a cross domain problem leads to " Cannot read property "childNodes"" I think about using this method to solve the problem,but there is no specific solution. public WebResponse getResponse(WebRequest request) throws IOException { if(request.getUrl().toExternalForm().contains("common2.js")){ .... } } -- View this message in context: http://htmlunit.10904.n7.nabble.com/How-to-solve-the-cross-domain-problem-caused-by-the-error-tp39637.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |