You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
508 B

#! /usr/bin/env python
import requests
from bs4 import BeautifulSoup
headers = requests.utils.default_headers()
headers.update({"User-Agent": "Mozilla/5.0"})
data = {
'codiceStazione': 'S01700Milano+Centrale',
'lang': 'IT',
r ='', headers=headers, data=data)
soup = BeautifulSoup(r.text, 'html.parser')
treni = soup.find_all("div", class_="bloccorisultato")
for treno in treni: