Skip to content

Instantly share code, notes, and snippets.

View relaiyavalli's full-sized avatar
🎯
Focusing

Ramesh Elaiyavalli relaiyavalli

🎯
Focusing
View GitHub Profile
@relaiyavalli
relaiyavalli / scrapNewsTitles.py
Last active August 29, 2015 14:02
Here is a simple Python code snippet to retrieve news titles from various news feeds. This example retrieves Technology news headlines from Reuters. All you need is urllib and cookielib installed. Please be careful only to scrap permissible sites and rss feeds.
import urllib2
import re
import cookielib
from cookielib import CookieJar
# If the web site expects cookies
cookie = CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie))
# Get Scrapper pose as Browser