В Selenium C#, как я могу получить текст из div, содержащего другой div? - PullRequest
0 голосов
/ 13 июля 2020

HTML:

<div class="items">
  "(I want this text.)"
  <div>"(I don't want these texts.)"</div>
  <div>"(I don't want these texts.)"</div>
</div>

C#:

var title = driver.FindElementByCssSelector(".items");
log("The title of items : " + title.Text);

Я хотел получить (I want this text.) Однако я мог получить (I want this text.)(I don't want these texts.)(I don't want these texts.). Как мне получить то, что я хочу?

...