[英]jsoup getting the url from table td
Element tables = doc.select("table")
Elements myTds = tables.select("td:eq(0)");
.....
thetext=td.text();
thehref=td.getElementsByTag("a[href]");
我正在从HTML页面读取表格。 我想读
<td>
<a href="student-profiles/andy.html">Andy</a>
</td>
我想阅读安迪和学生资料。 文本正在印刷安迪。 如何获得href? 我尝试了几件事,但未能成功。
//thehref=td.getElementsByTag("a“);
function simpleURL(){
var anchors = document.getElementsByTagName('a');
if(anchors != null & anchors.length > 0){
thehref= anchors[1].href;
}
}
我能够做到这一点:
元素myTds = table.select(“ td:eq(0)”); 比tds.attr(href);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.