问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
"""请求网页"""
import requests
import re
# 服务器反爬虫机制会判断客户端请求头中的User-Agent是否来源于真是浏览器,所以,我们使用Requests经常会指定UA伪装成浏览器发起请求
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36'}
response = requests.get('https://www.syt5.com/bizhi/mnbz/25881_3.html', headers=headers)
# response = requests.get('https://www.wmgirl.com/3070.html', headers=headers)
# print(response.request.headers)
# print(response.text)
html = response.text
"""解析网页"""
# ulrs = re.findall('<a href="(.*?)" alt=".*?" title=".*?">', html)
# ulrs = re.findall(r"https$",":htmls://img.syt5.com/2021/1216/20211216081031798.jpg.1680.0.jpg')
# print(ulrs)
ulrs = re.findall('<a href="(.*?)" alt=".*?" title=".*?">', html)
print(ulrs)
运行结果及报错内容 打印 提示 【】啥也不显示
我想要达到的结果