
commit
f50c8e5fdc
2 changed files with 22 additions and 0 deletions
@ -0,0 +1,2 @@ |
|||
.idea |
|||
|
@ -0,0 +1,20 @@ |
|||
#! /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 = requests.post('http://viaggiatreno.it/vt_pax_internet/mobile/stazione', headers=headers, data=data) |
|||
|
|||
print(r.text.encode('utf-8')) |
|||
soup = BeautifulSoup(r.text, 'html.parser') |
|||
treni = soup.find_all("div", class_="bloccorisultato") |
|||
|
|||
for treno in treni: |
|||
print(treno) |
Loading…
Reference in new issue