HTMLUnit executing form with javascript code

后端 未结 1 1914
醉话见心
醉话见心 2021-01-25 19:06

All i want to do is remotely ask a question on ask.fm using java nad HTMLUnit framework. I think it doesn\'t work because of the javascript code, but i\'m not sure.

this

相关标签:
1条回答
  • 2021-01-25 19:46

    You are doing it right, you are just not waiting enough for the submit to be processed. Add this after the HtmlPage click = button.click(); line:

    webClient.waitForBackgroundJavaScript(10 * 1000);
    

    It will wait 10 seconds. For a maybe nicer solution, you can try this one also.

    0 讨论(0)
提交回复
热议问题