import requests url = "http://www.spbeen.com" headers = { "User-Agent":"teste" } response = requests.get(url,headers=headers) print(response.status_code) print(response.headers) print(response.request.headers) def request_view(response): import webbrowser request_url = response.url base_url = '<head><base href="%s">' %(request_url) base_url = base_url.encode() content = response.content.replace(b"<head>",base_url) tem_html = open('tmp.html','wb') tem_html.write(content) tem_html.close() webbrowser.open_new_tab('tmp.html') request_view(response)