How to Get Crawl content in Crawljax

断了今生、忘了曾经 提交于 2019-12-01 14:10:58

We can able to get website source code cc.getBrowser().getStrippedDom()); or cc.getCurrentState().getDocument(); This coding are Return Source code (css/java script file)..

Not possible.Because its testing tool.This tool only check Text are available, assign temp data to Fields.

Quip Yowert

To get the website content, use the following function:

cc.getCurrentState().getDom()

This function does not return a DOM node, but actually returns the page's HTML text instead. This is the right function to use if you want the page content, but it sounds like it returns a DOM node, so the name getDom is a misnomer. To get a DOM node instead, use:

cc.getCurrentState().getDocument()

which returns the Document DOM node.

You can retrieve the page content with:

cc.getCurrentState().getDocument().getTextContent()

(EDIT: This won't work -- getTextContent always returns null when called on Documents.)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!