![]() |
|
[C#] c# grab data from url - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] c# grab data from url (/showthread.php?tid=5673911) |
c# grab data from url - Shadyx - Jul 20, 2017 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. * - Rageline - Jul 20, 2017 HtmlAgilityPack is a parser, if you mean directly from url there is Uri class in .NET * - Shadyx - Jul 20, 2017 (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. * - Shadyx - Jul 20, 2017 (Jul 20, 2017 03:42 AM)Rageline Wrote: Stop doing drugs. Are you actually going to help or what? stop flaming * - goshmulticoloredalto - Jul 20, 2017 (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. * - Shadyx - Jul 20, 2017 (Jul 20, 2017 06:05 AM)justsum1uknow 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/24431-fish-mask#.WXCuR9QrK9I 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 🎉 * - Shadyx - Jul 20, 2017 (Jul 20, 2017 06:32 AM)Orka 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 * - Ninja - Jul 20, 2017 To download a page you can use a WebClient. Specifically the DownloadString method. * - Zilog80 - Jul 20, 2017 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) * - Ninja - Jul 20, 2017 (Jul 20, 2017 12:07 PM)Zilog80 Wrote: Define 'pro' features. * - Shadyx - Jul 21, 2017 (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 * - +Haze - Jul 21, 2017 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. * - SL x TnT - Jul 23, 2017 (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. |