Récuperer des chiffres dans un fichier html

Messages postés
695
Date d'inscription
mercredi 17 novembre 2004
Statut
Membre
Dernière intervention
17 octobre 2019
- - Dernière réponse : ElementW
Messages postés
4889
Date d'inscription
dimanche 12 juin 2011
Statut
Contributeur
Dernière intervention
9 octobre 2019
- 30 mai 2019 à 12:59
Bonjour,

Je voudrais récupérer dans un fichier html, des chiffres, mais voilà les chiffres se trouve entre
],list:["
et
],short
en tenant compte qu'il y a des "," qui sépare les chiffres.

Exemple :
],list:["100014455780357-2","1618511704-2","1703543615-2","100000575675002-2","1600447202-2","100022202885575-2","100004822245477-2","100004445530785-2","100005135520989-2","100010088289427-2","100000465698975-2","1822320220-2","1551638000-2","100011108478619-2","100012636724684-2","100001413945230-2","100000742969613-2","100013240120637-2","100011177201922-2","1336517445-2","100001803177826-2","100000918616848-2","100009713748065-2","100010495816138-2","100022074492871-2","100010371345883-2","100003031978770-2","100008405498553-2","100012004085132-2","100004884990371-2","100017829734411-2","100030868115240-2","1134460506-2","100014455780357-0","100000575675002-0","1618511704-0","1600447202-0","100022202885575-0","100004822245477-0","100004445530785-0","100005135520989-0","100010088289427-0","1703543615-0","100000465698975-0","1822320220-0","1551638000-0","100011108478619-0","100012636724684-0","100001413945230-0","100000742969613-0","100013240120637-0","100011177201922-0","1336517445-0","100001803177826-0","100000918616848-0","100009713748065-0","100010495816138-0","100022074492871-0","100010371345883-0","100003031978770-0","100008405498553-0","100012004085132-0","100004884990371-0","100017829734411-0","100030868115240-0","1134460506-0"],short


Avec quoi puis-je récupérer les chiffre sous python ?

Merci.

Configuration: Linux / Firefox 67.0
Afficher la suite 

1 réponse

Messages postés
4889
Date d'inscription
dimanche 12 juin 2011
Statut
Contributeur
Dernière intervention
9 octobre 2019
857
0
Merci
'lut,
html = <ton contenu html>
start = '],list:["'
end = '"],short'
sep = '","'
print(html[html.find(start)+len(start):html.find(end)].split(sep))
Commenter la réponse de ElementW