from requests_html import HTMLSession
session = HTMLSession()
resp = session.get('http://www.spbeen.com/tool/request_info/')
ua = resp.html.xpath('.//div[@class="ui red segment"]/div[last()]')
print(ua[0].text) #获取网站的ua
pip install requests-html
from requests_html import HTMLSession
session = HTMLSession()
resp = session.get('http://www.spbeen.com/tool/request_info/')
ua = resp.html.xpath('.//div[@class="ui red segment"]/div[last()]')
print(ua[0].text) #获取网站的ua
pip install requests-html