def image_finder(soup,movie_name,movie_link): data = soup.select('a[href^="%s"]'%movie_link) try: image_link = (data[0].img["src"]).encode("ascii","ignore") image_proxy.image("actor_folder",image_link,movie_name) print image_link except: print " image not get for: "+movie_link
def image_finder(soup,movie_name,movie_link): #print movie_link try: data = soup.select('a[href="%s"]'%movie_link) image_link = data[0].img["src"].encode("ascii","ignore") image_proxy.image("achieves_dir",image_link,movie_name) return image_link except: return " image not get for: "+movie_link
def image_finder2(soup,movie_name,movie_link): length = len(movie_link) movie_name2 = movie_name[:(length/2)] if soup.find_all("img",attrs={"title":movie_name}): data = soup.find_all("img",attrs={"title":movie_name}) image_link = data[0]["src"].encode("ascii","ignore") image_proxy.image("actor_folder",image_link,movie_name) print image_link return image_link elif soup.find_all("img",attrs={"title":re.compile(movie_name2)}): data = soup.find_all("img",attrs={"title":re.compile(movie_name2)}) image_link = data[0]["src"].encode("ascii","ignore") image_proxy.image("actor_folder",image_link,movie_name2) print image_link return image_link else: print "no link for: "+movie_link