pattern = rhref=httpsvqqcomxcoverhref = researchpattern request如何取出查询到的所有数据
要取出查询到的所有数据,可以使用re.findall()函数。它返回一个列表,其中包含所有匹配到的字符串。
下面是一个示例代码:
import re
pattern = r'href="https://v\.qq\.com/x/cover/.*?"'
matches = re.findall(pattern, request)
for match in matches:
print(match)
这将打印出所有匹配到的字符串。你可以根据需要进行进一步处理或存储。
原文地址: https://www.cveoy.top/t/topic/jd6i 著作权归作者所有。请勿转载和采集!