Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98221

How to get value of WebElement

$
0
0

I am trying to loop through table elements on a page of our ERP system.

Based on a question I asked before I thought this would be a slam dunk - but I cannot figure it out.

Here's the latest code I've tried:

approved_suppliers = driver.find_elements_by_xpath("//tbody[@id='ApprovedSupplierBody']")
for supplier in approved_suppliers:
    print('Supplier',supplier.id)

if I substitute print('Supplier',supplier.id) with print('Supplier',supplier.value) I get the following error:

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

In the screenshot example I want the code to print 300 Below, and when there are multiple suppliers the names of the fields increase by 1. For example, pik_Supplier_1, pik_Supplier_2, etc.

enter image description here

Thank you for helping me!


Viewing all articles
Browse latest Browse all 98221

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>