Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib2
- website = ''
- findstr = ''
- 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
- temp = urllib2.urlopen(website)
- data = temp.read()
- datastr= urlfinder(data,findstr)
- print datastr[1:len(datastr)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement