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: Allows to select an HTML tag based on the tag content or properties.
  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” an EmailParser-specific method that can be easier to use in some cases but you will likely only find information about it on this website.    

© 2008-2021   FrozenFrog Software    PAD file     Privacy Policy & Terms of Use