Код: Выделить всё
from selenium.webdriver.remote.webelement import WebElement
def text(e: WebElement) -> str:
return e.text or e.get_attribute("textContent") or "n/a"
Код: Выделить всё
WebElement.get_attribute()Однако это не полная замена, поскольку WebElement.get_dom_attribute() будет отображать только атрибуты объявлено в разметке HTML.
Как мне добиться той же функциональности без WebElement.get_attribute()?
Подробнее здесь: https://stackoverflow.com/questions/792 ... selenium-4
Мобильная версия