标签:int https nbsp headers gecko tps ike ext from
import requests
from lxml import etree
url=‘https://ie.icoa.cn/‘
head={‘user-agent‘:‘Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36‘}
res=requests.get(url,headers=head) #通过设置 headers模拟浏览器
res.encoding=‘utf-8‘
root=etree.HTML(res.text)
ua=root.xpath(‘//table[@class="zebra"]/tr/td/i/text()‘)
print(ua)
标签:int https nbsp headers gecko tps ike ext from
原文地址:https://www.cnblogs.com/tiankong-blue/p/11594888.html