Advertisement
dereksir

Untitled

Oct 30th, 2023
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using HtmlAgilityPack;
  2.  
  3. class Scraper
  4. {
  5.     static async Task Main()
  6.     {
  7.         //..
  8.         {
  9.             //...
  10.  
  11.             HtmlDocument htmlDocument = new HtmlDocument();
  12.             htmlDocument.LoadHtml(htmlContent);
  13.  
  14.             HtmlNode stockElement = htmlDocument.DocumentNode.SelectSingleNode("//*[@id='product-752']/div[2]/p[2]");
  15.             string stockAmount = stockElement.InnerText;
  16.  
  17.             Console.WriteLine("Stock Amount: " + stockAmount);
  18.         }
  19.  
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement