Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium(Python):getAttribute(';value';)无法从文本输入中获取文本_Python_Selenium_Selenium Webdriver_Automated Tests - Fatal编程技术网

Selenium(Python):getAttribute(';value';)无法从文本输入中获取文本

Selenium(Python):getAttribute(';value';)无法从文本输入中获取文本,python,selenium,selenium-webdriver,automated-tests,Python,Selenium,Selenium Webdriver,Automated Tests,我正在尝试从文本输入中获取文本。我从Stackoverflow了解到我应该使用getAttribute('value')。这是我正在尝试的,但它不起作用(如下)。我得到一个错误: AttributeError:“WebElement”对象没有属性“getAttribute” getAttribute()是Java语法。请尝试使用getAttribute()。getAttribute()是Java语法。请尝试使用get\u attribute() audience_panel = self.bro

我正在尝试从文本输入中获取文本。我从Stackoverflow了解到我应该使用
getAttribute('value')
。这是我正在尝试的,但它不起作用(如下)。我得到一个错误:

AttributeError:“WebElement”对象没有属性“getAttribute”

getAttribute()
是Java语法。请尝试使用
getAttribute()

getAttribute()
是Java语法。请尝试使用
get\u attribute()

audience_panel = self.browser.find_element_by_id('input-panel')
network_text = audience_panel.find_element_by_id('network-code')
self.assertEqual(network_text.getAttribute("value"), "ABC")