2004-03-18, 20:12
passed 2 days i have been figuring out how to parse html to display what i want and have been able to get it to work. it's very simple and i get the desired results in my pc python shell.
here is the script:
i really don't have a clue how to make it appear in xbmc. do i have to gather the text into a file which i then display? how does this work?
like i said i'm a complete dummie, if i can just get this to display in any way or form i'd be happy and can go from there.
thank you.
here is the script:
Quote:import urllib2, re
for line in urllib2.urlopen('http://www.mbl.is/mm/frettir/'):
#get headline
if 'class="tm"' in line:
line = re.sub(r'<.*?>', '', line)
print line
#get newstext
if 'class="frettatexti"' in line:
line = re.sub(r'<.*?>', '', line)
print line
i really don't have a clue how to make it appear in xbmc. do i have to gather the text into a file which i then display? how does this work?
like i said i'm a complete dummie, if i can just get this to display in any way or form i'd be happy and can go from there.
thank you.