Last active
December 12, 2015 06:59
-
-
Save vjo/4733785 to your computer and use it in GitHub Desktop.
Open url with cookies
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 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