first init

This commit is contained in:
Valentin CZERYBA 2023-02-28 21:42:21 +01:00
commit 0262e99d22

12
web_scrap.py Normal file
View File

@ -0,0 +1,12 @@
#!/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', '/'))