>>> pattern='and the next nothing is \d+'
>>> value=12345
>>> while True:
url=Request('http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=%s'%value)
response=urllib2.urlopen(url)
page=response.read()
match=re.search(pattern,page)
if not match:
break;
else:
print page
v=re.search('[0-9]+',match.group())
value=v.group()
after getting the value 16044
then run the above code again with the initial value=8022:
Answer: peak.html
>>> value=12345
>>> while True:
url=Request('http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=%s'%value)
response=urllib2.urlopen(url)
page=response.read()
match=re.search(pattern,page)
if not match:
break;
else:
print page
v=re.search('[0-9]+',match.group())
value=v.group()
after getting the value 16044
then run the above code again with the initial value=8022:
Answer: peak.html