我正在尝试抓取该页面“ https://myanimelist.net/anime.php?letter=A ”,我找到了我想要的信息,但我想为每一行获取 i 并删除 //n /n
for anime in tree.xpath('//*[@id="content"]/div[5]/table//tr'):
data = {"title" : anime.xpath("//strong//text()").extract(),
"synopsis" : anime.xpath("//td[2]//text()").extract(),
"type_" : anime.xpath("//td[3]//text()").extract(),
"episodes" : anime.xpath("//td[4]//text()").extract(),
"score" : anime.xpath("//td[5]//text()").extract()}
此外,我什至不确定是否能捕捉到页面上的所有动漫。如果有人也可以向我展示一个 css 方法,那就太好了(目的是学习)