0

I am trying to get the top 10 stocks from fidelity website for a fund. There is a HTML element table with id="top-holdings-table". Why is that jsoup is not able to get hold of the table? How do I get hold of the rows in this table via jsoup?

 String url = "https://www.fidelity.co.uk/factsheet-data/factsheet/GB00B784NS11-axa-framlington-biotech-fund-z-acc/portfolio";
        org.jsoup.nodes.Document doc = null;
        try {
            doc = Jsoup.connect(url).get();
            Elements rows = doc.select("table#top-holdings-table");
            Elements tbody = rows.select("tbody");
            Elements tr = tbody.select("tr");
            System.out.println(tr);
        } catch (IOException e) {
            e.printStackTrace();
        }
serah
  • 1,841
  • 5
  • 28
  • 46
  • 1
    [Page content is loaded with JavaScript and Jsoup doesn't see it](https://stackoverflow.com/q/7488872). Use other tool like Selenium web driver instead of `jsoup` to get dynamic content. – Pshemo Oct 22 '21 at 18:41

0 Answers0