开发者

How to get ajax-updated text values on a webpage in HtmlUnit?

开发者 https://www.devze.com 2023-01-14 12:15 出处:网络
I have a website here which is continuously updated by Ajax. I\'m using HtmlUnit in Java and need to get the updated text values but I don\'t know how.

I have a website here which is continuously updated by Ajax. I'm using HtmlUnit in Java and need to get the updated text values but I don't know how.

For example: TextValue. When "TextValue" c开发者_开发问答hanged, how can I access the new value? I know there is a DomChangeListener (for added or removed nodes) and a HtmlAttributeChangeListener but I don't see a way the get the changed text values.

It must not necessarily be a notification (event), it would be ok for me to check the values manually every x seconds but the only way I tried is per page.asXML and page.asText, but the source is never updated, the values are always the first values when the page was loaded.

Anyone knows how to accomplish this task? Maybe another framework or completely other way to do it? Thanks.

Edit: It should run headless on a server. And the task it NOT to just refresh the page all the time to get the updated source-code.


http://sourceforge.net/tracker/?func=detail&aid=2818380&group_id=47038&atid=448269

it is a known bug in HTMLUnit, a patch is included at the link above

0

精彩评论

暂无评论...
验证码 换一张
取 消