Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import re
  2. import urllib2
  3.  
  4. url = "http://www.williamforemanpc.net/blog/2014/10/police-allegedly-find-marijuana-and-meth-in-arizona-residence.shtml"
  5. response = urllib2.urlopen(url)
  6. html = response.read()
  7.  
  8. rex = re.compile(r'<div class="containerPostContent container-post-content">(.*)</div>', re.IGNORECASE)
  9.  
  10. match = rex.search(html)
  11. if match:
  12. text = match.groups()[0].strip()
  13. print text
  14. else:
  15. print "No match found"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement