2

I am trying to grab elements and their respective attributes from a webpage using Jsoup in java. However, I've realized that there is some javascript that runs after the page has been loaded that creates a table, which holds all of the information I am trying to access on the page.

Using java, I was wondering if there is any way to access the updated HTML source after the javascript has executed so that I can grab the elements in the table that I need.

Thanks in advance.

THow
  • 119
  • 9

1 Answers1

0

jsoup doesn't support javascript execution, you'll have to use something else to load the page, grab the source and then pass it to jsoup to parse the info you want.

A couple libraries I have used in this situation:

There are others but these are the two I have used and feel comfortable recommending.

Oops, just did some Googling, seems this is a very similar question

Also, see this list of headless browsers. Great answer, I have this one bookmarked.

Community
  • 1
  • 1
bmcculley
  • 2,048
  • 1
  • 14
  • 17