Created
November 23, 2009 20:39
-
-
Save lqc/241353 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
# -*- coding: utf-8 | |
from lxml import html | |
if __name__ == '__main__': | |
document = html.parse("http://palacmlo.internetdsl.pl/") | |
header = document.xpath(u"//div[text() = 'Odwołane zajęcia']") | |
if not header: | |
print("Nie znaleziono odpowiedniego elementu na stronie - layout się zmienił :(") | |
else: | |
print "Odwołane zajęcia:" | |
div = header[0].getnext() | |
for par in div: | |
# par zawiera opis odwołanych zajęć | |
print ''.join(par.itertext()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment