Created
January 6, 2020 05:30
-
-
Save santhalakshminarayana/e446c66eb94055d0d6a8bd5ea54d0912 to your computer and use it in GitHub Desktop.
Web scrapping 1 - Medium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
import re | |
import os | |
import time | |
home_url = 'http://www.wiseoldsayings.com' | |
r = requests.get(home_url) | |
soup = BeautifulSoup(r.content, 'html5lib') | |
quote_classes = [] | |
quote_hrefs = [] | |
cat_list = soup.find('div', attrs = {'class':'cat_list'}) | |
for row in cat_list.findAll('li'): | |
quote_classes.append(row.text.strip()) | |
quote_hrefs.append(row.a['href'].strip()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment