Is there a way to only grab specific content from an HTTPGET request? For example, if the content I need for the email is contained within the <div id="the_content"> tag.

  <div id="the_content">
    I only want to grab the content within this div

I thought I saw something on this forum which showed how to do this, but unable to find it.


  • Forgot to mention this is for Exact Target. ;) – Johnny Yeip Sep 25 '15 at 18:56

It doesn't look like there's any native HTML parser in Apex, you'd have to parse through the httpresponse.getBody() just like any other string.

See here, and here for a way to do regex expression pattern matching which might help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.