get HTML Content Using URL in Dynamics Ax

Description:-

Here we will retrieve HTML Code from Website Address. Here I will show you how to get HTML Code from URL in Ax. Create Job and Insert your URL from Which Website HTML Code you want and run you’re Job to get in Infolog.

Code:-
static void WebClient(Args _args)
{
  System.Net.WebClientmyWebClient;
  System.IO.StreammyStream;
  System.IO.StreamReadermyStreamReader;
  str content;
  strmyURL="http://www.google.co.in";
  ;
  myWebClient = newSystem.Net.WebClient();
  myStream=myWebClient.OpenRead(myURL);
  myStreamReader = newSystem.IO.StreamReader(myStream);
  content=myStreamReader.ReadToEnd();
  info(content);
}

Output:-

Related Posts

Previous
Next Post »

4 comments

comments
October 4, 2017 at 1:34:00 PM GMT+5:30 delete

"Great blog created by you. I read your blog, its best and useful information. You have done a great work. Super blogging and keep it up.php jobs in hyderabad.
"

Reply
avatar
October 10, 2017 at 2:32:00 PM GMT+5:30 delete

Excellent…Amazing…. I’m satisfied to find so many helpful information here within the put up,for latest php jobs in near me. we want work out extra strategies in this regard, thanks for sharing.

Reply
avatar
April 9, 2018 at 2:34:00 PM GMT+5:30 delete

Can you help us in how can we parse the content elements?

Reply
avatar
April 9, 2018 at 2:50:00 PM GMT+5:30 delete

Hi Omari,
you can get XML element content using XML parser or else using XPath. please check below link.

https://msdn.microsoft.com/en-us/library/ms256086(v=vs.110).aspx
https://en.wikipedia.org/wiki/XPath

Reply
avatar

Thanks for comments.....