Created
June 24, 2013 20:04
-
-
Save thulio/5853117 to your computer and use it in GitHub Desktop.
Splinter user-agent getting rejected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
url = "http://guitarshop.com.br/prod,idloja,5372,idproduto,3575917,cordas-amp-guitarra-g5--15w-c--drive" | |
headers = {"User-Agent": "python/urllib"} | |
r = requests.get(url, headers=headers) | |
print(r.status_code) | |
headers = {"User-Agent": "python/splinter"} | |
r = requests.get(url, headers=headers) | |
print(r.status_code) | |
headers = {"User-Agent": "splinter"} | |
r = requests.get(url, headers=headers) | |
print(r.status_code) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment