web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How can I Read HTML element via X++

(0) ShareShare
ReportReport
Posted on by

I'm wondering if there is a better way to read an HTML element using X++.  I'm able to use System.Net.WebClient and System.IO.StreamReader to specify a localized webpage and read in the html file as a string. Then, using StrScan I can find the specific element beginning and end positions to parse out the string from the specific HTML element I'm looking for.  This works, but seems clumsy. 

I'm wondering if there is a better, more succinct way to specify a http website and pull a specific element out of that page in X++.  I can make it work as is, but I'd prefer to make it work better.  Any thoughts?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,967 Most Valuable Professional on at

    Consider using regular expressions instead of strScan(). You won't get anything for that in AX itself, nevertheless you can easily call System.Text.RegularExpressions.Regex class through .NET Interop.

    Alternatively, you could use some .NET libraries for parsing HTML.

    And if your page is actually well-formed XHTML, you can use any tools for XML.

  • Community Member Profile Picture
    on at

    Looks like Regular Expressions can do what I'm looking for.  Thanks for the suggestion.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans