Skip to content

Instantly share code, notes, and snippets.

View johncalabrese's full-sized avatar

John Calabrese johncalabrese

  • Boston, MA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am johncalabrese on github.
  • I am johncalabrese (https://keybase.io/johncalabrese) on keybase.
  • I have a public key ASDdKbc17WIY_D66qYRXXgbW3hQrQFGjkP4q5TxS7EDs1Ao

To claim this, I am signing this object:

def handler(event, context):
cur_dt = "{:%B %d, %Y}".format(datetime.datetime.now())
ACCESS_KEY_ID = 'ENTER_KEY_HERE'
ACCESS_SECRET_KEY = 'ENTER_SECRET_KEY_HERE'
BUCKET_NAME = 'ENTER_DESTINATION_BUCKET_HERE'
FILE_NAME = cur_dt + "ADD_LABEL_HERE.csv"
data = scrap_webpage()
def scrap_webpage():
webpage_url = "WEBPAGE_URL"
page = urlopen(webpage_url)
soup = BeautifulSoup(page, "html.parser")
# search all html lines containing table data
news_row = soup.find_all('tr', {'class': ['nn']})
news = []
for story in news_row:
news.append(story.find('a').contents[0])