Python 正则表达式提取单位名称:从响应文本中获取所有单位
import re
定义正则表达式模式
pattern = '"user_name":"(.*?)","user_phone'
使用 re.findall() 提取所有匹配结果
results = re.findall(pattern, response.text)
循环遍历匹配结果并输出
for result in results: print(result)
原文地址: https://www.cveoy.top/t/topic/lNhP 著作权归作者所有。请勿转载和采集!