Advertisement
dereksir

Untitled

Oct 30th, 2023
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using HtmlAgilityPack;
  2. using Fizzler.Systems.HtmlAgilityPack;
  3.  
  4. class Scraper
  5. {
  6.     static async Task Main()
  7.     {
  8.         //..
  9.         {
  10.             //...
  11.  
  12.             HtmlDocument htmlDocument = new HtmlDocument();
  13.             htmlDocument.LoadHtml(htmlContent);
  14.  
  15.             // Load the HTML content intoHtmlAgilityPack
  16.             HtmlDocument htmlDocument = new HtmlDocument();
  17.             htmlDocument.LoadHtml(htmlContent);
  18.  
  19.             // Use Fizzler to select the stock element using a CSS selector
  20.             var stockElement = htmlDocument.DocumentNode.QuerySelector(".stock");
  21.                
  22.             string stockAmount = stockElement.InnerText;
  23.             Console.WriteLine("Stock Amount: " + stockAmount);
  24.         }
  25.  
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement