Im trying to change my user-agent using the code below. But it gets recognized as "python-requests/2.22.0"
from lxml import html import requests headers = { 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36' } page = requests.get('http://www.useragentstring.com/') tree = html.fromstring(page.content) userAgent = tree.xpath('//*[@id="uas_textfeld"]/text()') print(userAgent[0]) 