[1] Ouija - Spiel Nicht Mit Dem Teufel [Do. 22.01.] [2] Mortdecai - Der Teilzeitgauner [Do. 22.01.] [3] John Wick [Do. 29.01.] [4] Let's Be Cops - Die Partybullen [Do. 29.01.] [5] Blackhat [Do. 05.02.] [6] Frau Mller Muss Weg [Do. 05.02.] [7] Schndung [Fr. 06.02.] [8] Fifty Shades Of Grey [Do. 12.02.] [9] Wild Card [Do. 12.02.] [10] Fifty Shades Of Grey [Do. 19.02.] [11] Jupiter Ascending [Do. 19.02.] [12] Da muss Mann durch [Fr. 20.02.] [13] The Interview [Do. 26.02.] [14] Fifty Shades Of Grey [Do. 26.02.] [15] Black Sea [Fr. 27.02.] [16] Let's Be Cops - Die Partybullen [Fr. 20.02.]
#!/bin/python from BeautifulSoup import BeautifulSoup import urllib2 aschheim = 'http://www.autokinos-deutschland.de/programm/index-muenchen-aschheim.php?cPath=22' gravenbruch = 'http://www.autokinos-deutschland.de/programm/index-frankfurt-gravenbruch.php?cPath=24' essen = 'http://www.autokinos-deutschland.de/programm/indexessen.php?cPath=25' porz = 'http://www.autokinos-deutschland.de/programm/index-koeln-porz.php?cPath=26' kornwestheim = 'http://www.autokinos-deutschland.de/programm/index-stuttgart-kornwestheim.php?cPath=27' program_aschheim = [] program_gravenbruch = [] program_essen = [] program_porz = [] program_kornwestheim = [] program_all = [] def remove_duplicates(values): output = [] seen = set() for value in values: if value not in seen: output.append(value) seen.add(value) return output def getProgram(url): filmstarts = [] i=0 response = urllib2.urlopen(url) html = response.read() soup = BeautifulSoup(html.decode('utf-8', 'ignore'), convertEntities=BeautifulSoup.HTML_ENTITIES) allg = soup.findAll("table", {"class" : "productListing"}) einzelnfilm = allg[0].findAll("td", {"class" : "productListing-data"}) for rows in einzelnfilm: startdatum = "" titel = einzelnfilm[i+1].find("div",{"class" : "FilmHeading1"}) runtime_raw = einzelnfilm[i+1].findAll("tr") runtime = runtime_raw[2].findAll("td",{"class" : "productDesc"}) filmtitel = titel.string.strip() startdatum += runtime[0].string.strip() + " " startdatum += runtime[1].string.strip() filmstarts.append(str(filmtitel + " [" + startdatum + "]")) i += 2 if i == len(einzelnfilm): break return filmstarts program_all = getProgram(aschheim) program_essen = getProgram(essen) program_gravenbruch = getProgram(gravenbruch) program_porz = getProgram(porz) program_kornwestheim = getProgram(kornwestheim) #Ja, ist crappy. for linie in program_essen: program_all.append(str(linie)) for linie in program_gravenbruch: program_all.append(str(linie)) for linie in program_porz: program_all.append(str(linie)) for linie in program_kornwestheim: program_all.append(str(linie)) #Ausgabe u = 1 for low in remove_duplicates(program_all): print "[" + str(u) + "] " + low u += 1
#