Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automation WEB sel+Python
#2
You store tags in a variable,then a for loop over tags and use .text collect fixed result as show under in list.
Then use sum().
span_tag =  browser.find_elements_by_xpath('//span[@class="basket-item__price-total_discount js__total-price"]')
For one tag it would be.
>>> span_tag[0].text
'194 ₽'
# Fix so only get 194
>>> span_tag[0].text.split()[0]
'194'
# Integer
>>> int(span_tag[0].text.split()[0])
194
Reply


Messages In This Thread
Automation WEB sel+Python - by ABVSVL - Jul-02-2020, 06:15 AM
RE: Automation WEB sel+Python - by snippsat - Jul-02-2020, 08:04 AM
RE: Automation WEB sel+Python - by ABVSVL - Jul-02-2020, 09:50 AM
RE: Automation WEB sel+Python - by snippsat - Jul-02-2020, 03:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Automation Engine on Python? jfha73 4 2,187 May-01-2020, 02:29 PM
Last Post: jfha73
  Python Script-To perform automation of excel values which need to be feeded into we mrinal3411 1 2,480 Jul-14-2018, 06:12 PM
Last Post: Larz60+
  [Intermediate] Python web Automation testing vardhhan 0 3,534 Feb-18-2018, 06:23 AM
Last Post: vardhhan
  Python Selenium Document Lookup and Download Automation Error - Target Machine active Guttmann 4 5,272 Apr-18-2017, 12:13 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020