1
0
Fork 0
Scripts/mediapart-edition.py

11 lines
314 B
Python
Raw Normal View History

2022-02-02 15:16:22 +01:00
#!/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())