Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using HtmlAgilityPack;
- using Fizzler.Systems.HtmlAgilityPack;
- class Scraper
- {
- static async Task Main()
- {
- //..
- {
- //...
- HtmlDocument htmlDocument = new HtmlDocument();
- htmlDocument.LoadHtml(htmlContent);
- // Load the HTML content intoHtmlAgilityPack
- HtmlDocument htmlDocument = new HtmlDocument();
- htmlDocument.LoadHtml(htmlContent);
- // Use Fizzler to select the stock element using a CSS selector
- var stockElement = htmlDocument.DocumentNode.QuerySelector(".stock");
- string stockAmount = stockElement.InnerText;
- Console.WriteLine("Stock Amount: " + stockAmount);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement