Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //..
- // Select all list items within the unordered list
- var listItems = document.QuerySelectorAll("ul li");
- // Storing list items in a list for further processing
- List<string> itemList = new List<string>();
- // Loop through each list item
- foreach (var item in listItems)
- {
- // extract the text content
- var itemText = item.TextContent ?? "Not available";
- itemList.Add(itemText);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement