Advertisement
dereksir

Untitled

Nov 28th, 2023 (edited)
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. //..
  2.         // Select all list items within the unordered list
  3.         var listItems = document.QuerySelectorAll("ul li");
  4.  
  5.         // Storing list items in a list for further processing
  6.         List<string> itemList = new List<string>();
  7.  
  8.         // Loop through each list item
  9.         foreach (var item in listItems)
  10.         {
  11.             // extract the text content
  12.             var itemText = item.TextContent ?? "Not available";
  13.             itemList.Add(itemText);
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement