Advertisement
dereksir

Untitled

Oct 31st, 2023
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using CSQuery
  2.  
  3. class Scraper
  4. {
  5.     static async Task Main()
  6.     {
  7.         //..
  8.         {
  9.             //...
  10.  
  11.             // Load the HTML content into CsQuery
  12.             CQ dom = CQ.Create(htmlContent);
  13.  
  14.             // Find the stock amount element using a CSS selector
  15.             CQ stockElement = dom.Find(".stock");
  16.  
  17.             // Extract the stock amount text
  18.             string stockAmount = stockElement.Text();
  19.             Console.WriteLine("Stock Amount: " + stockAmount);  
  20.         }
  21.  
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement