Commit f8467fff authored by Landon DeCoito's avatar Landon DeCoito

code can now parse out a list of events from the xml

parent e1d239e8
......@@ -4,11 +4,18 @@ import requests
from bs4.diagnose import diagnose
from bs4 import BeautifulSoup
r = requests.get("http://25livepub.collegenet.com/calendars/events_all.xml")
soup = BeautifulSoup(r.content, "lxml")
#r = requests.get("http://25livepub.collegenet.com/calendars/events_all.xml")
f = open("events.xml", "r")
soup = BeautifulSoup(f.read(), "lxml")
entries = soup.find_all('entry')
tempent = entries
print type(entries[0])
for entry in entries:
ladle = BeautifulSoup(entry.toString(), "lxml")
entries.extend(ladle.find_all('title'))
print type(entries[0]), "\n"
print entries[0].prettify(), "\n"
print entries[0].find('content').prettify(), "\n"
titles = []
for item in entries:
ladle = BeautifulSoup(unicode(item.string), "lxml")
titles = ladle.find_all('title')
print titles
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment