Skip to content

Commit

Permalink
fix regex bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LvehaoShen committed Dec 18, 2022
1 parent 010a106 commit a51458d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weibospider/spiders/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def parse(self, response, **kwargs):
网页解析
"""
html = response.text
tweet_ids = re.findall(r'\d+/(.*?)\?refer_flag=1001030103_\'\)">复制微博地址</a>', html)
tweet_ids = re.findall(r'\d+/(.*?)\?refer_flag=1001030103_" ', html)
for tweet_id in tweet_ids:
url = f"https://weibo.com/ajax/statuses/show?id={tweet_id}"
yield Request(url, callback=self.parse_tweet, meta=response.meta)
Expand Down

0 comments on commit a51458d

Please sign in to comment.