[suivi] Fix colissimo tracking
This commit is contained in:
parent
bb0e958118
commit
c23dc22ce2
@ -31,16 +31,17 @@ def get_tnt_info(track_id):
|
|||||||
|
|
||||||
|
|
||||||
def get_colissimo_info(colissimo_id):
|
def get_colissimo_info(colissimo_id):
|
||||||
colissimo_data = getURLContent("http://www.colissimo.fr/portail_colissimo/suivre.do?colispart=%s" % colissimo_id)
|
colissimo_data = getURLContent("https://www.laposte.fr/particulier/outils/suivre-vos-envois?code=%s" % colissimo_id)
|
||||||
soup = BeautifulSoup(colissimo_data)
|
soup = BeautifulSoup(colissimo_data)
|
||||||
|
|
||||||
dataArray = soup.find(class_='dataArray')
|
dataArray = soup.find(class_='results-suivi')
|
||||||
if dataArray and dataArray.tbody and dataArray.tbody.tr:
|
if dataArray and dataArray.table and dataArray.table.tbody and dataArray.table.tbody.tr:
|
||||||
date = dataArray.tbody.tr.find(headers="Date").get_text()
|
td = dataArray.table.tbody.tr.find_all('td')
|
||||||
libelle = re.sub(r'[\n\t\r]', '',
|
if len(td) > 2:
|
||||||
dataArray.tbody.tr.find(headers="Libelle").get_text())
|
date = td[0].get_text()
|
||||||
site = dataArray.tbody.tr.find(headers="site").get_text().strip()
|
libelle = re.sub(r'[\n\t\r]', '', td[1].get_text())
|
||||||
return (date, libelle, site.strip())
|
site = td[2].get_text().strip()
|
||||||
|
return (date, libelle, site.strip())
|
||||||
|
|
||||||
|
|
||||||
def get_chronopost_info(track_id):
|
def get_chronopost_info(track_id):
|
||||||
|
Loading…
Reference in New Issue
Block a user