2014-02-05, 07:25
I am just a beginner and would appreciate if somebody can help with generating a list. I am actually editing Macedoniaondemand (big thank you to the author) python script I have made few changes and they are working but I cannot figure out how to get the series that are only in <div class="all_shows"> to be displayed.
I have been reading the wiki to figure out but no luck
<div class="all_shows">
<ul data-letter="A">
<li><a href="http://www.hrt.hr/enz/abeceda-zdravlja/">Abeceda zdravlja</a></li>
<li><a href="http://www.hrt.hr/enz/alpe-dunav-jadran/">Alpe Dunav Jadran</a></li>
</ul>
This is the relevant python script
def createHRTSeriesListing():
url='http://www.hrt.hr/enz'
req = urllib2.Request(url)
req.add_header('User-Agent', user_agent)
response = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('<li><a href="(.+?)">(.+?)</a></li>').findall(link)
return match
match=re.compile('<li><a href="(.+?)">(.+?)</a></li>').findall(link) lists all the links which is exactly what it should do but I want it to only
display inside this <div class="all_shows">
Thank you
I have been reading the wiki to figure out but no luck
<div class="all_shows">
<ul data-letter="A">
<li><a href="http://www.hrt.hr/enz/abeceda-zdravlja/">Abeceda zdravlja</a></li>
<li><a href="http://www.hrt.hr/enz/alpe-dunav-jadran/">Alpe Dunav Jadran</a></li>
</ul>
This is the relevant python script
def createHRTSeriesListing():
url='http://www.hrt.hr/enz'
req = urllib2.Request(url)
req.add_header('User-Agent', user_agent)
response = urllib2.urlopen(req)
link=response.read()
response.close()
match=re.compile('<li><a href="(.+?)">(.+?)</a></li>').findall(link)
return match
match=re.compile('<li><a href="(.+?)">(.+?)</a></li>').findall(link) lists all the links which is exactly what it should do but I want it to only
display inside this <div class="all_shows">
Thank you