How to get data from another page (different servers)

141 Views Asked by At

I want to make a IE8 web slice who will show remaining amount of students "food credit". In our country we have web page where we can see amount www.cap.srce.hr/ProvjeraSaldo.aspx. When I fill textbox with my card number I receive remaining amount. Now, I want to speed that process with IE8 web slice. So is it possible to get data from another webserver page and than display it in my web slice on my web server. I tried to use XMLHTTP request but it can be only used on same domains. Url for getting amount is :

http://www.cap.srce.hr/saldo.aspx?brk={number_of_card}

2

There are 2 best solutions below

0
Michael Lorton On BEST ANSWER

Several ways, depending on your situation:

  1. As an IFRAME (if you get the other server to render HTML instead of Javascript)
  2. As JSONP
  3. Through a server-side proxy
  4. Through a Flash bridge (which would require a crossdomain.xml on the other server)
0
rjovic On

Tnx Malvolio. I found other solution using ASP.NET. More info on this page : http://www.csharp-station.com/HowTo/HttpWebFetch.aspx . After you fetch web page source you can try parse elements using Regex or I found more easy way using great library HtmlAgilityPack (http://htmlagilitypack.codeplex.com/)