Skip to content

Instantly share code, notes, and snippets.

@lqc
Created November 23, 2009 20:39
Show Gist options
  • Save lqc/241353 to your computer and use it in GitHub Desktop.
Save lqc/241353 to your computer and use it in GitHub Desktop.
# -*- 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