Skip to content

Instantly share code, notes, and snippets.

@sakjur
Created February 4, 2015 16:26
Show Gist options
  • Save sakjur/1ec749383e72d062821d to your computer and use it in GitHub Desktop.
Save sakjur/1ec749383e72d062821d to your computer and use it in GitHub Desktop.
# Copyright (c) 2015, Emil Tullstedt
# This code is licensed under the BSD-license as per http://opensource.org/licenses/BSD-2-Clause
#
# (I pinkyswear that I'll never sue you even _if_ you manage to break that license. I mean. C'mon. It's like 6 LOC)
from lxml import html
import urllib2
import re
dagen = urllib2.urlopen("http://www.dagen.se/bibelordet")
tree = html.fromstring(dagen.read())
qotd = tree.xpath('//div[@id="quoteOnly"]/text()')[0]
qotd = re.sub(r'\s\s+', '', qotd)
print(qotd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment