20

Can I fill out forms, execute events and Javascript functions in Jsoup? If yes how can I? Or should I go for another parser.

1
  • 1
    How did you fix this? could you get what you want Commented Dec 1, 2015 at 20:49

2 Answers 2

37

JSoup is just an HTML parser/"tidyfier" - not a browser emulator. To interact with HTML pages (execute javascript, fill out forms, etc.) you should use a tool like HtmlUnit or Selenium.

Sign up to request clarification or add additional context in comments.

1 Comment

OK Ok. I have a problem, I have two dropdowns on HTML page. When one drop down is changed, the options in other dropdown change. I want to change the first dropdown value in Java code, and then get the new values in the second dropdown, how can I do it in HTML unit?
3

Use Selenium - if you use Selenium 2 WebDriver API, the main classes there are WebDriver, FirefoxDriver, and JavascriptExecutor.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.