【发布时间】:2012-02-19 01:55:44
【问题描述】:
这是我查找价格的代码。
a = prompt("Link?")
window.location = a
var priceElement = document.getElementById('UserSalesTab').getElementsByTagName('tr')[1].getElementsByTagName('td')[2].getElementsByTagName('b')[0]; // Get the element that contains the price
var price = parseInt(priceElement.innerHTML.match(/\d+/));
【问题讨论】:
-
发布 HTML 的示例 sn-p
-
这是不可能的。您需要在页面上提供一些参考,在内部搜索一些元素以使搜索范围更窄。给我们这个“价格”和一些周边元素的 HTML。
-
R$980
-
@nPwn 显示整个代码,而不仅仅是您要查找的元素。
-
我的代码还是页面的整个HTML代码?
标签: javascript search