Skip to content

Instantly share code, notes, and snippets.

@DanBrink91
Created March 30, 2014 02:57
Show Gist options
  • Save DanBrink91/9866724 to your computer and use it in GitHub Desktop.
Save DanBrink91/9866724 to your computer and use it in GitHub Desktop.
Scraping
import requests
from bs4 import BeautifulSoup
term = "trigun"
url = "http://www.nyaa.se/?page=search&cats=0_0&filter=0&term=%s" % term
r = requests.get(url)
soup = BeautifulSoup(r.text)
titles = soup.select('.tlistname')
print titles
print [title.contents for title in titles]
#print soup.prettify().encode('utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment