I need selenium to select a button with the html code of:
<a href="stuMain.php?datasetID=31561">583</a>
There are over a thousand buttons and each button has two different numbers in the datasetID and the number after that. I do not need to select a certain button, I just need one with the second number present and the datasetID present as well.
I did not know how to do this, I tried selecting by tag but there are other tags on the page (the 'a' tag) that do not link to what I want.
Examples of buttons to press:
<a href="stuMain.php?datasetID=31561">583</a>
<a href="stuMain.php?datasetID=31553">575</a>
Examples of what not to press:
<font color="red">579</font>
<a href="preview.php?datasetID=31557">View</a>
This is what I tried:
dataset = driver.find_element_by_tag_name('a')
dataset.click()