HackerShackOfficial / Smart-Mirror

Raspberry powered mirror which can display news, weather, calendar events
MIT License
911 stars 384 forks source link

HTML in smartmirror.py #87

Closed marcoleder closed 1 year ago

marcoleder commented 7 years ago

Hello guys

So I am nearly finished with my maturapaper. I am getting close to deadline (2 months) and wanted to add a "widget" which displays the timetable/classroomtable. I was able to web scrape all the informations I need out of the timetablewebsite and now I need to display them in the smartmirror.py file.

My main question is:

Is there a possibility in outputting html in the smartmirror.py file? (the data is already webscraped) How can I do that? If not, how would I be able to make suchs a widget?

Best regards Marco Leder

Attachement:

My Code (changed the link so it doesn't work)

import urllib2 from bs4 import BeautifulSoup

ken = "https://ntr.k.ch/stuan/lasstgslan/" page = urllib2.urlopen(ken)

soup = BeautifulSoup(page, "html5lib")

tableVar = soup.find('table',attrs={'class': 'full'}) w4bdiv = tableVar.find("div", string="W4b") classTr = w4bdiv.find_parent("tr") print classTr

marcoleder commented 1 year ago

no response -> closing