from requests_html import HTMLSessionsession = 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