diff --git a/parserHTML.py b/parserHTML.py index 686927e..986f43c 100644 --- a/parserHTML.py +++ b/parserHTML.py @@ -41,6 +41,16 @@ def load_jsonfile(file): with open(file, 'r', encoding='utf-8') as f: return json.load(f) -parsechaine() -data=load_jsonfile('chaine.json') -print(data["0"]) \ No newline at end of file + +def parse_emmission(URL): + response = urllib.request.urlopen(URL) + html = response.read() + parse=BeautifulSoup(html,"html.parser") + link=parse.select_one(".prog_name") + return {'title':link['title'],'href':("https://www.programme-tv.net"+link['href'])} + + +print(parse_emmission("https://www.programme-tv.net/rechercher?q=France+3")) +#parsechaine() +#data=load_jsonfile('chaine.json') +#print(data["0"]) \ No newline at end of file