Email Parser

Extract data from incoming emails and automate your workflow

MENUMENU
DOCUMENTATION TOPICSDOCUMENTATION TOPICS

Capturing an HTML tag

 

See also:
Capturing an HTML tag with XPath expressions
Capturing an HTML tag with CSS selectors
Capturing an HTML tag based on its tag properties

 

Every incoming email in Email Parser has a predefined set of fields (From, To, Subject…), for the actual content of the email we have two: Body and Body_HTML. In the Body field you will find the plain text version of the contents of the email and in Body_HTML you will find the same text but in HTML, where different fonts, colors and images are supported. The latter is the one that most email clients (Outlook, Windows mail…) use to show to the user the actual email.

HTML can get quite complicated and this is the reason Email Parser offers three different ways of capturing text from it:

  • XPATH expressions: These are path-like expressions (/div/tr/td…)  that show where the HTML tag you want to capture is located based on it parent tags. Like a path of a folder in your computer file system (C:\Users\John\….)
  • CSS selectors: Usually, the HTML tags are labeled with a given class or id, CSS selectors use that to identify a specific tag. For instance “#header” or “.bold_text”.
  • By the HTML tag properties: A more custom way that based on specific tag properties and content allows you to capture a specific tag

 

XPATH expressions and CSS selectors are widely used in other contexts, not only email parsing. You can find a lot of information on them online. For the contrary “capturing an HTML tag by tag properties” it is a more EmailParser-specific method that can be easier to use in some cases but you will likely only find information about it on this website.