From a03489ee2141b2584c07d0505254791c5e962ce7 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Tue, 28 Feb 2023 22:03:03 +0100 Subject: [PATCH] menu nav list --- web_scrap.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/web_scrap.py b/web_scrap.py index f5a7ccf..dff226d 100644 --- a/web_scrap.py +++ b/web_scrap.py @@ -9,11 +9,8 @@ page = requests.get("https://www.clarissariviere.com") if page.status_code == 200: soup = BeautifulSoup(page.text, 'html.parser') - for anchor in soup.find_all('a'): - print(anchor.get('href', '/')) -#with urllib.request.urlopen('https://www.clarissariviere.com/index.html') as response: -# print(response) - #webpage = response.read() - #soup = BeautifulSoup(webpage, 'html.parser') - #for anchor in soup.find_all('a'): - # print(anchor.get('href', '/')) \ No newline at end of file + ul = soup.find_all("ul", id="listsmooth") + for anchor in ul[0].find_all("a"): + href = anchor.get('href', '/') + if href != "#" and href != "http://www.clarissariviere.com/": + print(href)