From: Евгений П. <pec...@ya...> - 2015-12-26 05:39:06
|
<div>Hello, dear sirs!</div><div> </div><div>Thank you for awesome HtmlUnit, unfortunately, this time it doesn't help me.</div><div>Can you check if it's a bug in Htmlunit, or the site is too ugly?</div><div> </div><div>This is not my website, I just extract information from it on payed subscription.</div><div><a href="http://spark3.spark-interfax.ru/">http://spark3.spark-interfax.ru/</a></div><div>I cannot even login to it.</div><div> </div><div>This severe problem, reported by HtmlUnit, may cause problems.</div><div> </div><div><strong>Dec 26, 2015 12:18:56 PM com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter runtimeError</strong></div><div><pre><strong>SEVERE: runtimeError: message=[An invalid or illegal selector was specified (selector: '*,:x' error: Invalid selector: *:x).] sourceName=[http://spark3.spark-interfax.ru/content/build/18122015/js/vendor.js] line=[1] lineSource=[null] lineOffset=[0]<br /><br /></strong></pre></div><div>This js-file is downloadable, but unfortunately is compressed.</div><div> </div><div>I'm not a js expert, so struggle to figure if selector "*:x" is allowed by standards or not. Please, comment.</div><div> </div><div> </div><div>My code is kind of:</div><div><pre>protected WebClient webClient; webClient = new WebClient(BrowserVersion.CHROME); webClient.getOptions().setCssEnabled(true); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setTimeout(30000); webClient.setJavaScriptTimeout(30000); webClient.getOptions().setPopupBlockerEnabled(true); webClient.getOptions().setRedirectEnabled(true); webClient.getCookieManager().setCookiesEnabled(true); webClient.setCssErrorHandler(new com.gargoylesoftware.htmlunit.SilentCssErrorHandler()); webClient.getOptions().setPrintContentOnFailingStatusCode(true); HtmlPage activePage = webClient.getPage("http://spark3.spark-interfax.ru/"); webClient.waitForBackgroundJavaScript(20000); java.io.FileWriter writer = new java.io.FileWriter("/tmp/1.html", false); writer.write(activePage.asXml()); writer.close();</pre></div><div> </div><div>Tried to turn css on/off, popups, redirects, downgrade to HU2.18 from 2.19, all emulated "browsers" in HTMLUNIT. All the same.</div><div> </div><div> <pre><span> </span></pre></div><div> </div> |