<table class="table1">
<tbody>
<tr class="tablerow1">
<td valign="top">
<strong>
<a href="http://www.wineweb.com/scripts/wineryPg.cfm/11094/Aan-de-Doorns-Co%2Dop/" target="_top">Aan de Doorns Co-op </a> </strong> </td></tr>
</tbody>
</table>
这是一个示例HTML,实际上有多行多列的单元格。这就是我所做的。
$('table.table1').each(function(k, elem) {
$(this).find('tr').each(function(j, elem){
$(this).find('td').each(function(i,elem){
console.log($(this).find('strong a').attr('href'));
})
})
});
但是我无法通过这种方法获取href。
$('table.table1').each(function(){console.log($(this).find('tr>td>strong>a').attr('href'));});
- Mr. Polywhirl