Created
March 10, 2013 11:44
-
-
Save syst3mw0rm/5128265 to your computer and use it in GitHub Desktop.
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 mechanize | |
from BeautifulSoup import BeautifulSoup | |
import time | |
user_agent = ("sadsds") | |
br = mechanize.Browser() | |
br.addheaders = [('User-agent', user_agent)] | |
start = time.clock() | |
response = br.open("http://backdoor-problems.cognizance.org.in/misc75/misc75.php") | |
html = response.read() | |
soup = BeautifulSoup(html) | |
p = str(soup.p) | |
number = int(p[70:74]) | |
s = 1 | |
br.select_form(nr=0) | |
br['answer'] = str(s) | |
br.submit() | |
print br.response().read() | |
print("elapsed %.2fs" % (time.clock() - start)) | |
print s | |
print p | |
print number |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment