Using XPath in Selenium or BeautifulSoup in Python, how can one get the tag-names (here 'a', 'button') and the values of 'aria' attributes (here Home, True, False) by knowing that those attributes start with 'aria'
<a aria-label="Home" id="1" />
<button aria-hidden="True" id="2" />
<button aria-pressed="False" id="2" />
Currently, I have to put in all attributes one-by-one, like this
driver.find_elements_by_xpath("//*[@aria-label]")
driver.find_elements_by_xpath("//*[@aria-pressed]")
What I need is something like (which, here, isn't correct),
driver.find_elements_by_xpath("//*@[starts-with('aria')]")