0

I'm using selenium and have some problems. I try to get the text or value of an element, but it is showed in HTML a bit different from what I see on the web-page.

For example,on the site which give HTML from your URL (https://sitedozor.ru/get-source-code-of-webpage/) I enter site https://plus.yandex.ru/dacha , and the HTML code showing on the page in textbox is not like in HTML code of the page. Can I get text of textbox?

VLAD
  • 1
  • 1
  • I found this answer https://stackoverflow.com/questions/67428799/how-to-get-a-text-with-selenium-if-the-element-doesnt-show-it but it was on java and I'm not sure that problem is the same, cause there was input box – VLAD Aug 22 '22 at 05:28

1 Answers1

0

You're trying to get the text from the input element, correct?

In that case you can't use .text like you would for a WebElement representing a p, span, etc DOM element.

For elements you need to us .get_attribute("value"), this will return the current value of the input field.

RJB
  • 31
  • 4