Answer the question
In order to leave comments, you need to log in
How to get last div element in c#?
In general, there is such a piece of html.
I need to get the text from the last div element. For example, at the moment I get the ninth element like this:
var textmsg = webDriver.FindElement(By.XPath("//*[@id='main']/div[3]/div/div/div[2]/div[9]/div/div/div/div[1]/div/span[1]/span")).Text;
string textmsgS = Convert.ToString(textmsg);
Console.WriteLine(textmsgS);
Answer the question
In order to leave comments, you need to log in
It is logical to call the last function
https://xsltdev.ru/xpath/last/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question