ChromeSpider工具爬取百度排行榜游戏Top200

exports.main = async function main(ctx) {
  const nameList = document.querySelectorAll('#main > div.mainBody > div > table > tbody > tr')
  const result = [];
  i = 0
  for (const item of nameList) {
      title = item.querySelector('td.keyword > a.list-title')
      if(title){
        result.push(title.textContent);
      }
  }
  ctx.data = result;
};

猜你喜欢

转载自blog.csdn.net/u011939633/article/details/98626163