Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import urllib2
- import re
- data = []
- def getURLSource(linkToURL):
- try:
- response = urllib2.urlopen(linkToURL)
- html = response.read()
- return html
- except:
- print("It didn't work :(")
- def getAllYTLinks(source):
- pattern = 'http://www.youtube.com/embed/...........'
- action = re.compile(pattern)
- result = re.findall(action, source)
- data.append(result)
- def IterateOverURLs(baseURL):
- for i in range(119):
- source = getURLSource(baseURL + str(i*10))
- getAllYTLinks(source)
- baseURL = 'http://www.outbreak-community.com/viewtopic.php?f=45&t=149&start='
- IterateOverURLs(baseURL)
- print data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement