Skip to content

Instantly share code, notes, and snippets.

@terryp
terryp / bs_v_pq.py
Created December 28, 2011 16:38
Beautiful Soup v. PyQuery
...
page = b.get_html()
soup = BeautifulSoup.BeautifulSoup(page)
first_headline = soup.find('div',
{"class" : "news-stream-module headlines cf"}).findNext('ol').li
first_headline_bs = first_headline.a.contents
print first_headline_bs
assert first_headline_bs