开发者

Java HTMLUnit - How do I access the page DOM I'm sent to after submitting a form

开发者 https://www.devze.com 2023-01-08 04:54 出处:网络
I\'m very confused on how to access the newly loaded page\'s DOM after I .click() the submit开发者_C百科 button on a page and am sent to another one.

I'm very confused on how to access the newly loaded page's DOM after I .click() the submit开发者_C百科 button on a page and am sent to another one.

Any ideas?

Thanks.


The click() method should return an HtmlPage object with the new page:

HtmlPage newPage = myElement.click();


Since you're being redirected to a new page, wouldn't you handle that page's DOM just like you normally would? In jQuery you would use:

$(document).ready()

And when the DOM has finished loading, you can manipulate it however you want.

0

精彩评论

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