Hello guys,im wondering how could I get data from an external url so I can do a live price check of a certain item has the prices changes every 24h my app requires the value to update every 00:00.
|
C#
c# grab data from url |
|
Jul 20, 2017 03:20 AM
(This post was last modified: Jul 20, 2017 03:27 AM by Shadyx.)
(Jul 20, 2017 03:09 AM)Rageline Wrote: HtmlAgilityPack is a parser, if you mean directly from url there is Uri class in .NET I have looked into htmlagilityPack,but doesn't it require acess to the website ftp to upload the file? Edit: It's not from the actual url but from the page. (Jul 20, 2017 05:56 AM)Shadyx Wrote: Are you actually going to help or what? stop flaming You could help us by giving details like the name of the website? You'd probably want to use HttpWebRequest for getting the source of the page, then parse it for the price. (Jul 20, 2017 06:05 AM)goshmulticoloredalto Wrote: You could help us by giving details like the name of the website? Im sorry my bad, so the idea is to get today's price from this link http://www.grandexchangewatch.com/item/2...XCuR9QrK9I Has you open the page,you can see the prices by date,but the only price that I want to get from that page is today. Thanks 🎉 (Jul 20, 2017 06:32 AM)Owl Wrote: Data looks to be retrieved from ajax (their source is unobfuscated.) Try reversing it to save downloading and parsing a huge page. How can I do that? Thanks for the help
Jul 20, 2017 10:09 AM
(This post was last modified: Jul 20, 2017 10:09 AM by Ninja.)
To download a page you can use a WebClient. Specifically the DownloadString method.
Jul 20, 2017 12:07 PM
(This post was last modified: Jul 20, 2017 12:08 PM by Zilog80.)
Code view-source:http://www.grandexchangewatch.com/item/24431-fish-mask#.WXCuR9QrK9IPHP Code Price: 1,954,084gp This can be 'parsed' without external dependencies in 2 minutes (3 minutes if you want 'pro' features) (Jul 20, 2017 12:07 PM)Zilog80 Wrote: Define 'pro' features. (Jul 20, 2017 07:54 PM)Ninja Wrote: Define 'pro' features. Thanks guys! you made it way more clear now,I had no idea how to do this,I might report the progress when im done with it. Regards
Jul 23, 2017 10:31 AM
(This post was last modified: Jul 23, 2017 10:32 AM by SL x TnT.)
(Jul 21, 2017 01:12 PM)+Haze Wrote: Ultimately you'd want to use a HTML parser to extract data from the HTML document. A parser like AngleSharp or HTMLAgilityPack works good. I prefer AngleSharp. The data he's looking for appears to be right here Code var baseurl = "http:\/\/www.grandexchangewatch.com";The values in the HTML are the historical prices. Easy enough to grab using Regex. |
|
|



