Open sushengbuhuo opened 2 years ago
可能现在的代码还存在bug,我现在不方便调试,到时候再看看。
改了下可以了
def get_article_url(self, selector):
"""获取微博中头条文章的url"""
article_url = ''
text = selector.xpath('string(.)')
if text.startswith(u'发布了头条文章'):
url = selector.xpath('//a/@href')
if url and url[0].startswith('https://'):
article_url = url[0]
return article_url
感谢反馈并给出了解决方法。如果方便,您可以以pull request的方式提交代码吗?这样你可以成为本项目的contributor,这不是强制的,如果不方便,我在以后自己修改。再次感谢。
抓取的uid 5044429589(填了cookie) ,抓的excel里头条文章url都是空的,不知道什么问题?