To get the text inside an HTML element using Selenium in C#, you can use the Text
property of the IWebElement
interface. Here's an example:
main.cs483 chars21 lines
In this example, we create a new instance of the Chrome driver and navigate to a web page. We then find an element using a CSS selector and get the text inside the element using the Text
property. Finally, we print the text to the console and quit the driver. You can modify this code to suit your specific needs.
gistlibby LogSnag