Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib
- u = urllib.urlopen('http://thuchienuocmo.vn/vi/xem-video/353/NGUYEN-THI-MAI-ANH.html?menu=joinus')
- 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
- number = urlfinder(data,'"td_number_of_like"')
- number = number[0]+number[2:5]
- number = int(number)
- print number
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement