Yi Dai
Yi Dai
> 没关,因为大部分微博点赞就是0,如果你获取的是热门微博,应该能看到点赞数。 但是我人工搜索会发现,那个点赞数是在那儿的
> 是最新的程序吗?之前有点赞问题 #109 ,后来解决了。 谢谢引索到这个issue,我和ta的问题是一样的,我用的是master版本的程序,我本来也想尝试和ta一样去debug一下,发现有点难单独测试(或者直接整体测试看变量输出),请问有什么这方面的教程吗或者小提示 :)
> 你可以搜索scrapy的教程。或设置只获取热门微博,看看有点赞数吗。 谢谢! 我觉得我好像解决了这个问题。 原来用来定位"评论"和“点赞”的代码位置是:search.py ``` comments_count = sel.xpath('.//a[@action-type="feed_list_comment"]/text()').extract_first() attitudes_count = sel.xpath('.//span[@class="woo-like-count"]/text()').extract_first() ``` 评论是可以的,但是点赞不行,点赞部分修改为: ``` attitudes_count = sel.xpath('.//a//em/text()').extract_first() ``` debug的方法: 在attitudes_count 部分插入(https://docs.scrapy.org/en/latest/topics/shell.html#topics-shell-inspect-response) ``` from scrapy.shell import inspect_response inspect_response(response, self) ```...
> @VictorQueiroz Seems that I found somewhat workaround - try to set config like this: > > ``` > hiresscroll: { > hires: true; > invert: false; > target: true;...
> > Hi Dai, is this script just an example for how other people can do this? Yes, just thought it would be nice to share it here. > Python...