I'm trying to find attribute using find_element_by_xpath with multiple attributes.
HTML:
<table id="idMainGridhistoryHeader" border="0" class="adodb_dbgrid" qhelp="2.2_zahlavisloupce">
...
</table>
<table id="idMainGridhistory" agname="history" userid="1" entityidcolumnname="hi_id" editable="1" border="0" class="adodb_dbgrid" scrollx="0">
... # id I want to find idMainGridhistory
</table>
I was tried this:
driver.find_element_by_xpath("//table[contains(@class, 'adodb_dbgrid') and contains(@userid, '1')]").get_attribute('id')
And this:
driver.find_element_by_xpath("//table[@class='adodb_dbgrid'][@userid='1']").get_attribute('id')
but everything will return Unable to locate element. Any advice how to find it with multiple elements?