1
0
Fork 0

mediapart-edition

This commit is contained in:
dece 2022-02-02 15:16:22 +01:00
parent 1c1c29942e
commit 81e377037d

10
mediapart-edition.py Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env python3
"""Get the current Mediapart edition. Requires requests and beautifulsoup4."""
import requests
from bs4 import BeautifulSoup
html = requests.get("https://www.mediapart.fr").text
soup = BeautifulSoup(html, "html.parser")
text = soup.select("div.nav__title._sm")[0].text
print(text.strip())