[英]Empty object x-ray scraper in node.js not working
我想得到這里http://search.azlyrics.com/search.php?q=tired+adele結果的第一個鏈接
使用x 射線 node.js 刮刀。 我的代碼如下:
x('http://search.azlyrics.com/search.php?q=tired+adele', {
link: x('body > div.container.main-page > div > div > div > table > tbody > tr:nth-child(1) > td > a')
})(function(err, data){
console.log(data);
});
不知道為什么我得到了空對象。 選擇器似乎不起作用。
源 html 中沒有 tbody。 從您的代碼中刪除它,它將起作用
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.