我想用python爬取微博热搜榜的数据,思路是先解码网页源代码(decode),再用正则表达式(re)匹配,但是输出显示为空
import requests
import re
headers={
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.82"
}
response=requests.get("https://s.weibo.com/top/summary?cate=realtimehot"
,headers=headers)
info=response.content.decode('utf-8','ignore')
content=re.findall(r'<td class="td-02">\s*<a href="(.*?)".target="_blank">(.*?)</a>',info,re.S)
print(content)
请问是哪一步做错了呢?😣