Advertisement
AndrewHaxalot

Untitled

Feb 24th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. from bs4 import BeautifulSoup
  2. import urllib
  3.  
  4. page = urllib.urlopen('paste url here')
  5.  
  6.  
  7. soup = BeautifulSoup(page)
  8. zeug = soup.find('div', attrs={'class': 'fm_linkeSpalte'})
  9.  
  10. content = zeug.get_text() # strip=True
  11.  
  12. f = open('schulen.txt', 'a')
  13. f.write(content.encode('utf8'))
  14. f.write("\n\n\n_______________________\n\n\n")
  15. f.close()
  16.  
  17. # print content
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement