Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib
- u = urllib.urlopen('http://learnprobyjack.pe.hu/')
- data = u.read()
- def urlfinder(html,string):
- #condition
- i = 0
- if html.find(string) == -1:
- print 'Web site khong co muc "' + string + 'nay'
- return 0
- if (html.find(string) != -1) or (html.find(string) != 0):
- while i >= 0:
- if html[html.find(string)+len(string)+i] == '<' and html[html.find(string)+len(string)+i+1] == '/':
- return html[html.find(string)+len(string)+1:html.find(string)+len(string)+i]
- break
- i = i + 1
- print urlfinder(data,'number')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement