def __retrieve_tv_shows__(tv_channel_url): tv_shows = [] if tv_channel_url is None: return tv_shows tv_channel_url = BASE_WSITE_URL + tv_channel_url contentDiv = BeautifulSoup.SoupStrainer('div', {'class':'all-tv-shows'}) soup = HttpClient().get_beautiful_soup(url=tv_channel_url, parseOnlyThese=contentDiv, accept_500_error=True) list_item = soup.find('ul') for item in list_item.findChildren('li'): aTag = item.findChild('a') tv_show_url = str(aTag['href']) if tv_show_url[0:4] != "http": tv_show_url = BASE_WSITE_URL + '/' + tv_show_url tv_show_name = aTag.getText() tv_shows.append({"name":http.unescape(tv_show_name), "url":tv_show_url, "iconimage":""}) return tv_shows
def __retrieve_tv_shows__(tv_channel_url): tv_shows = [] if tv_channel_url is None: return tv_shows tv_channel_url = BASE_WSITE_URL + tv_channel_url contentDiv = BeautifulSoup.SoupStrainer("div", {"class": "all-tv-shows"}) soup = HttpClient().get_beautiful_soup(url=tv_channel_url, parseOnlyThese=contentDiv, accept_500_error=True) list_item = soup.find("ul") for item in list_item.findChildren("li"): aTag = item.findChild("a") tv_show_url = str(aTag["href"]) if tv_show_url[0:4] != "http": tv_show_url = BASE_WSITE_URL + "/" + tv_show_url tv_show_name = aTag.getText() tv_shows.append({"name": http.unescape(tv_show_name), "url": tv_show_url, "iconimage": ""}) return tv_shows
def __retrieve_tv_shows__(tv_channel_url): tv_shows = [] if tv_channel_url is None: return tv_shows tv_channel_url = BASE_WSITE_URL + tv_channel_url contentDiv = BeautifulSoup.SoupStrainer('div', {'class': 'all-tv-shows'}) soup = HttpClient().get_beautiful_soup(url=tv_channel_url, parseOnlyThese=contentDiv, accept_500_error=True) list_item = soup.find('ul') for item in list_item.findChildren('li'): aTag = item.findChild('a') tv_show_url = str(aTag['href']) if tv_show_url[0:4] != "http": tv_show_url = BASE_WSITE_URL + '/' + tv_show_url tv_show_name = aTag.getText() tv_shows.append({ "name": http.unescape(tv_show_name), "url": tv_show_url, "iconimage": "" }) return tv_shows