From eda4baa011c24e3907e573435dc2b9d05cee43f4 Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 18 Aug 2018 19:09:10 +0200 Subject: [PATCH] =?UTF-8?q?ajout=20de=20la=20variable=20href=20a=20parse?= =?UTF-8?q?=20emission=20pour=20eviter=20r=C3=A9p=C3=A9tition=20de=20progr?= =?UTF-8?q?amme-tv.net?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chaineTV.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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):