Hello Community,
I’m having trouble parsing part of the data from incoming emails, specifically the client’s name and surname.
The issue is that when converting HTML to text, I can’t correctly extract the desired text because the name and surname may consist of 2 to 4 variables.
Example of HTML to text conversion:
yaml
Копировать код
Auftragsnummer: 1112889199Auftragsdatum: 03.03.2025Bestellnummer: IT100315797000460ADAlcon Lieferscheinnummer: 1630130652Sendungsverfolgungsnummer: ZUGTMV0VVersanddienstleister: General Logistics SystemsLieferadressePflege Das GmbHMartin-Luther-Straße 1410777 BerlinDeutschlandLiebe Kundin, lieber Kunde,vielen Dank für Ihre Bestellung. Ihre Bestellung #1112889199 wurde versendet. Bitte überprüfen Sie die beigefügte Versandbestätigung.Mit freundlichen Grüßen,Alcon Customer Service**Dies ist eine automatisch generierte E-Mail. Bitte antworten Sie nicht darauf.**Wir senden Ihnen Versandaktualisierungen an die von Ihnen angegebene E-Mail-Adresse.
I am particularly interested in this part:
Lieferadresse Pflege Das GmbH
Because there can be 1, 2, 3, or even 4 words after “Lieferadresse”, it’s difficult to define a fixed rule for extracting this text correctly.
I thought that parsing the data from HTML instead of text might be possible since the HTML structure provides elements to rely on, but I haven’t been successful so far.
Here’s an example of the HTML content:
(span style=“vertical-align:baseline;background-color:transparent;margin:0;padding:0;border:0;font-family:‘Arial Unicode MS’,sans-serif;font-size:10.00000pt;font-weight:bold;font-style:normal;color:#000000;text-decoration:none;” lang=“de-DE”>Lieferadresse
Can someone advise me on how I can parse the necessary data correctly?