diff --git a/chaineTV.py b/chaineTV.py index da0ddd1..f32f85a 100644 --- a/chaineTV.py +++ b/chaineTV.py @@ -151,7 +151,8 @@ def parse_emmission(URL): html = response.read() parse=BeautifulSoup(html,"html.parser") link=parse.select_one(".prog_name") - response = urllib.request.urlopen(("https://www.programme-tv.net"+link['href'])) + href="https://www.programme-tv.net"+link['href'] + response = urllib.request.urlopen(href) html = response.read() parse=BeautifulSoup(html,"html.parser") divcasting=parse.select_one(".descriptif") @@ -164,7 +165,7 @@ def parse_emmission(URL): img=divsynopsis.find_next('img')['data-src'] synopsis=divsynopsis.select_one(".d-b").text - return {'title':link['title'],'href':("https://www.programme-tv.net"+link['href']),'casting':casting,'synopsis':synopsis,'img':img} + return {'title':link['title'],'href':href,'casting':casting,'synopsis':synopsis,'img':img} def cli(num):