There is an HTML page in Selenium:

<span class="menu-title" style="color:#ff6613"> <strong>34535.23</strong> </span> 

You need to get the value 34535.23

Bye done using BeautifulSoup:

 html = driver.page_source soup = BeautifulSoup(html, 'lxml') 

And further with the help of resular expressions. How to implement it using only Selenium?

    2 answers 2

    Try the following:

     from selenium import webdriver url = 'google.com' # твой url driver = webdriver.Firefox() driver.get(url) value = driver.find_element_by_xpath("//span[@class='menu_title']//strong") print(value) 

    value - the value to get.

      Slightly edited the answer above. Since it is necessary to obtain a text value in the tag, it must be explicitly specified.

       from selenium import webdriver url = 'http://yandex.ru' driver = webdriver.Chrome() driver.get(url) value = driver.find_element_by_css_selector("span.text_black_yes") print(value.text) 

      Because if you just print out value, you get an object.