Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. from bs4 import BeautifulSoup
  2. import urllib.request
  3.  
  4. req = urllib.request.Request("http://boards.4chan.org/g/catalog", headers={'User-Agent' : "Magic Browser"})
  5. soup = BeautifulSoup(urllib.request.urlopen(req), "html.parser")
  6. data2 = soup.find_all("div", attrs={"id": "threads"})
  7. print (data2)
  8.  
  9. data3 = soup.find_all("div", attrs={"class": "thread"})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement