Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- import urllib2
- url = "http://www.williamforemanpc.net/blog/2014/10/police-allegedly-find-marijuana-and-meth-in-arizona-residence.shtml"
- response = urllib2.urlopen(url)
- html = response.read()
- rex = re.compile(r'<div class="containerPostContent container-post-content">(.*)</div>', re.IGNORECASE)
- match = rex.search(html)
- if match:
- text = match.groups()[0].strip()
- print text
- else:
- print "No match found"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement