I have a site that looks like this and I want to extract the contents of the uid field using firefox + selenium + python. There is only 1 UID per page.
<div class= "parent" >
<div class="module profile" dcp="1" uid="90">
...
...
</div>
</div>
To make it concrete see the following:
<div class= "parent" >
<div class="module profile" dcp="1" uid="[RETURN THIS]">
...
...
</div>
</div>
I've tried several techniques in selenium including using
browser.find_elements_by_name
browser.find_elements_by_xpath
browser.find_elements_by_class_name
browser.find_elements_by_css_selector
But none of them are able to return the UID. I either get an empty set or I only get the class (i.e. the entire module class rather than the attributes inside the DIV).
I saw some folks recommend the get_attribute selector but I was unsuccessful in applying it to this use case.
Any guidance would be appreciated, thanks.