How to get text with selenium web driver in python

0
0

I’m trying to get text using selenium web driver and here is my code. Please note that I don’t wanna use Xpath, because in my case id gets change on every re-launch of the web page, help please.

my code:

text=driver.find_element_by_class_name("current-stage").getText("my text")

simple HTML:

span class="current-text" id="yui_3_7_0_4_1389185744113_384">my text</span
  • You must to post comments
0
0

You want just .text.

You can then verify it after you’ve got it, don’t attempt to pass in what you expect it should have.

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website