使用jsoup遍历iframe

我有像这样的html结构。 我想得到没有类或id的第二个表。 我如何从iframe获取第二个表?

    

我是这样想的

 Elements iframe = doc.select("iframe"); for(Element e : iframe) { System.out.println(e.child(0)); } 

谁能帮我?

你想遍历iframe元素吗? 最好从iframe源获取内容

 Element iframe = doc.select("iframe").first(); String iframeSrc = iframe.attr("src"); if(iframeSrc != null) { iframeContentDoc = Jsoup.connect(iframeSrc).get(); } 

你只能这样做。