Skip to content

Instantly share code, notes, and snippets.

@thulio
Created June 24, 2013 20:04
Show Gist options
  • Save thulio/5853117 to your computer and use it in GitHub Desktop.
Save thulio/5853117 to your computer and use it in GitHub Desktop.
Splinter user-agent getting rejected
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