Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (19.7k points)

I am trying to extract the text in an input box,

<input type="text" name="inputbox" value="name" class="box">

I started with

input = driver.find_element_by_name("inputbox")

I tried input.getText() but I got

AttributeError: 'WebElement' object has no attribute 'getText'

1 Answer

0 votes
by (62.9k points)

You may need to use .get_attribute("value"). instead of .text.

Hope this helps!

If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s Selenium course!

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...