-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMetro_ss.py
More file actions
26 lines (19 loc) · 778 Bytes
/
Metro_ss.py
File metadata and controls
26 lines (19 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from bs4 import BeautifulSoup
import requests
url = r"https://en.wikipedia.org/wiki/List_of_stations_of_the_Paris_M%C3%A9tro"
response = requests.get(url)
soup_page = BeautifulSoup(response.content, "html.parser")
the = soup_page.find_all('th')
print(the)
tre = soup_page.find_all('tr')
print(tre)
for line in the:
line = soup_page.find_all(the=['station', 'numero'])
print(line)
for line in tre:
line = soup_page.find_all(tre=['station', 'numero'])
print(line)
# Trouver tous les tag th dans le site web
# url = r"https://en.wikipedia.org/wiki/List_of_stations_of_the_Paris_M%C3%A9tro"
# Dans ce site web travailler avec les tags th et tr pour retourner tous les noms des stations de metros et son numero de ligne associe.
# choisir son format de donnees