off for disabling CSS in HTMLUnit?
I experienced slowness in HTMLUnit 2.12, and therefore disabled CSS as explained in HTMLUnit : super slow execution?.
I want to understand what the trade-off is. Does it mean that I cannot use XPath selectors? Are there other tradeoffs?
XPath selectors only take into account the html/xml document. CSS does not affect your queries. If it would then it would have non-deterministic results based on whatever CSS rule was applied.
As far as CSS selectors and XPath selectors go, you can safely use those without loading any CSS beforehand. Loading them will have no effect on the result you will receive.
For the CSS to have any influence on your usage of HTMLUnit is for your code or the JavaScript code loaded to depend on the computed style of the elements.
链接地址: http://www.djcxy.com/p/13152.html上一篇: 如何停止登录按钮应用程序请求朋友列表权限
下一篇: 关闭在HTMLUnit中禁用CSS?