Created
October 14, 2016 04:34
-
-
Save skibum55/9885f5caea74695d7b3c17c4e0c4808b to your computer and use it in GitHub Desktop.
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 urllib2 | |
from bs4 import BeautifulSoup | |
url = "https://cs109alabs.github.io/lab_files/" | |
page = urllib2.urlopen(url).read() | |
soup = BeautifulSoup(page) | |
with open('output.txt', 'w') as f: | |
for tr in soup.find_all('tr')[1:]: | |
tds = tr.find_all('td') | |
f.write("Time: %s, X-Coord: %s,Y-Coord: %s,Z-Coord: %s\n" % \ | |
(tds[0].text, tds[1].text, tds[2].text,tds[3].text)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment