Skip to content

Instantly share code, notes, and snippets.

@vjo
Last active December 12, 2015 06:59
Show Gist options
  • Save vjo/4733785 to your computer and use it in GitHub Desktop.
Save vjo/4733785 to your computer and use it in GitHub Desktop.
Open url with cookies
import urllib2
with open('hack_file.txt') as f:
content = f.readlines()
for id in content:
headers = {'Cookie': 'cookie1=value1; cookie2=value2; cookie3=value3;'}
url = "http://url.com/id/%s" % id
req = urllib2.Request(url, None, headers)
resp = urllib2.urlopen(req)
print "%s : %s" % url, resp.getcode()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment