user2323331 user2323331 - 2 months ago 17x
Java Question

Traverse Iframe using jsoup

I have html structure like this. I want to get the second table that has no class or id. How would I get the second table from the



I am trying like this

Elements iframe ="iframe");

for(Element e : iframe) {

Can anyone help me?


Do you want to traverse the iframe element? It is better to get the content from iframe source like

Element iframe ="iframe").first();
String iframeSrc = iframe.attr("src");

if(iframeSrc != null) {
    iframeContentDoc = Jsoup.connect(iframeSrc).get();

You can do this way only.