I have been using JSOUP for all my html website requirements thus far. I have however, ran into a roadblock. Kickass gets the full list of files from each torrent by clicking a javascript link <a href="javascript:getFiles('52261EB9480EDFD83B5B85C8C4817D28F3AE0C95', 1);" class="showmore folded">. I have traced the javascript function back to a *.js file that is used but I am not sure how to mimic this behaviour. Ideally I would just like to grab the javascript link from the main site, and get the list like I would with any other website, though everything for JSOUP seems to follow html links rather than javascript ones.
So I tried with HtmlUnit. I inspected the site with chrome: https://kickass.to/australian-aria-top-50-singles-13-10-2014-t9702189.html
and copied the xpath expression. Currently the below does not work, while I would like to get around having to use this library for a single function, I can't get it work in general.
My Test Code:
java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel(java.util.logging.Level.OFF);
WebClient webClient = new WebClient(BrowserVersion.CHROME);
HtmlPage page = webClient.getPage("https://kickass.to/australian-aria-top-50-singles-13-10-2014-t9702189.html");
HtmlElement htmlElement = page.getFirstByXPath("//*[@id=\"ul_top\"]/tbody/tr[31]/td[2]/a");
System.out.println(htmlElement.toString());
htmlElement.click();
webClient.waitForBackgroundJavaScript(1000);
//get changes here
webClient.closeAllWindows();