Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib
- def find_the_url():
- global numero
- escape = 0
- list1 = []
- searchphrase = 'next nothing is'
- while escape == 0:
- locallist = []
- url = "http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing="+str(numero)
- conn = urllib.urlopen(url)
- for line in conn.fp:
- line = line.strip()
- locallist.append(line)
- conn.close()
- text5 = '\n'.join(locallist)
- if searchphrase in text5:
- win = text5.find(searchphrase)
- list1 = []
- for a in text5[win:]:
- if a.isdigit():
- list1.append(a)
- numero = ''.join(list1)
- print numero," ",text5
- else:
- print text5
- escape = 1
- numero = 12345
- #numero = 8022
- find_the_url()
- """
- look for number after 'next nothing is'
- """
Advertisement
Add Comment
Please, Sign In to add comment