我正在尝试使用以下代码从实时网页的表格中提取特定行的数据。
requestCrossDomain('https://eosweb.larc.nasa.gov/cgi-bin/sse/grid.cgi?&num=197110&lat=23&submit=Submit&hgt=100&veg=17&sitelev=&email=skip@larc.nasa.gov&p=grid_id&p=T10M&p=DLYRANGE&step=2&lon=16', function(results) {
$('#loadedContent').css("display","").html(results);
//alert($($('#loadedContent table')[4]).text());
//The above line parses the table i need and displays the content in an alert box.
//But when I try the same line of code to display a specific row, it doesnt display anything
alert($($('#loadedContent table tr:eq(2)')[4]).text());
});
请注意,网站不会为其页面中的表分配名称或 ID。所以我尝试使用该位置提取表格。在此之前我已经相当成功了。但是当我尝试从表中提取特定行的数据时。我不能。我应该怎么做才能从表中提取一行数据。
P.S:页面中有多个表,并且没有为每个表分配名称或id
最佳答案
关于javascript - 从表中提取一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32823653/