Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Macbull committed May 3, 2016
1 parent 3e55826 commit f51db35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scrapping_methods.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Methods for scrapping certain information from news.google.com
"""Methods for scrapping certain information from news.google.com"""

import urllib2
from bs4 import BeautifulSoup

#Method to scrap RSS Link
def get_rss_link(url):
"""Method to scrap RSS Link"""
html = urllib2.urlopen(url).read()
soup = BeautifulSoup(html)
rss_link = soup.find('img','feed-icon').parent['href']
return str(rss_link)

#Method to scrap RTC Links
def get_rtc_links(url):
"""Method to scrap RTC Links"""
html = urllib2.urlopen(url).read()
soup = BeautifulSoup(html)
links=[]
Expand All @@ -20,8 +20,8 @@ def get_rtc_links(url):
links.append('http://news.google.com'+str(link['href']))
return links

#Method to scrap SEE ALL ARTICLES Link
def get_see_all_link(url):
"""Method to scrap SEE ALL ARTICLES Link"""
html = urllib2.urlopen(url).read()
soup = BeautifulSoup(html)
link = soup.find('a','more-coverage-text')['href']
Expand Down

0 comments on commit f51db35

Please sign in to comment.