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
# Adapted from example in "Web Scraping with Python, 2nd Edition" by Ran Mitchell. | |
import csv | |
from urllib.request import urlopen | |
from bs4 import BeautifulSoup | |
html = urlopen("http://en.wikipedia.org/wiki/" | |
"Comparison_of_text_editors") | |
soup = BeautifulSoup(html, "html.parser") | |
table = soup.findAll("table", {"class":"wikitable"})[0] |