web_scrap/web_scrap.py
2023-02-28 21:42:21 +01:00

12 lines
354 B
Python

#!/usr/bin/python3
# Python 3
# Extraction des liens d'une page web
from bs4 import BeautifulSoup
import urllib.request
with urllib.request.urlopen('https://www.clarissariviere.com/') as response:
webpage = response.read()
soup = BeautifulSoup(webpage, 'html.parser')
for anchor in soup.find_all('a'):
print(anchor.get('href', '/'))