我想提取动态网页,我无法通过雅虎管喂上所有的ISBN(用户必须登录到看到的网页)。有没有办法做到这一点使用jQuery?怎么样?

修改 以下结构:

下面是的HTML是什么样子该网页上的例子。还有,有一个系列在他们<table>元素的<tr>。样品那些之一看起来大致是这样的:

<tr> 
  <td>(required/optional)</td>
  <td>LAFORE</td>
  <td>OBJECT ORIENTED PROGRAMMING IN C++ 4E</td>
  <td>9780672323089</td>
  <td>(course and section)</td>
  <td>(pricing information)</td>
</tr> 

有任何的这些没有id属性,该结构是公虽然定义

谢谢!

有帮助吗?

解决方案

//ideally provide better table selector if multiple tables are there
var isbns = $.makeArray($("table tr td:nth-child(4)"));
for(var i in isbns) {
  isbns[i] = isbns[i].innerHTML;
  alert(isbns[i]);
}
//now isbns is an array which contains all isbns found in the table
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top