mirror of
https://github.com/guezoloic/millesima-ai-engine.git
synced 2026-03-28 18:03:47 +00:00
15 lines
405 B
Python
15 lines
405 B
Python
from bs4 import BeautifulSoup
|
|
import requests as rq
|
|
|
|
def getsoup(s: str) -> BeautifulSoup:
|
|
return BeautifulSoup(rq.get(s).text, 'html.parser')
|
|
|
|
def test_soup():
|
|
assert getsoup("https://example.com").find('h1').text == "Example Domain"
|
|
|
|
soup = getsoup("https://www.millesima.fr/")
|
|
|
|
def nimportequoi() :
|
|
links = soup.find_all('a')
|
|
for link in links:
|
|
print(link.get('href')) |