Get Content From Javascript Onclick Hyperlink
I'm trying to get the content from a website, that uses 'onClick' instead of 'href' in hyperlinks, so the url is always the same, despite of the page you are seeing. http://www.sas
Solution 1:
Jsoup.connect(url).data("nav", "index@4;02", "opt", "4;02", "chvP", "127").post();
Solution 2:
You can get the value of onclick with jsoup
http://jsoup.org/cookbook/extracting-data/attributes-text-html
Just replace the line
String linkHref = link.attr("href"); with this String handler = link.attr("onclick");
However after that there is no way to construct the URL unless you can somehow map the magic number to 4,02
Post a Comment for "Get Content From Javascript Onclick Hyperlink"