I have a button that I'm trying to click and need some help from the group. This button is found in the backend / admin area of my wordpress site (I'm trying to mass upload data into a directory listing system). I'm thinking that I need to use the button class because there are two data-id elements with the same number on the same page. I have provided my selenium code (python) attempts as well as the html I'm trying to access. Any help appreciated!!
HTML:
<div class="pkg-button">
<a data-id="38579" class="btn btn-lg btn-primary button select-plan">Select</a>
</div>
Here's the html code snippet that has the conflicting id.
<ul data-price="0" data-subscribed='0' data-id="38579" data-type="1" class="packagelistitems " >
=============
Code Method 1:
elem = driver.find_element_by_id("38579").click()
Code Method 2:
driver.find_element_by_class_name('btn btn-lg btn-primary button select-plan').click()
Code Method 3:
elements = driver.find_elements_by_class_name("btn btn-lg btn-primary button select-plan")
for e in elements:
e.click()
Code Method 4:
driver.find_element_by_xpath('//*[@id="plan"]/div[1]/ul/li/div/div/div[2]/div[2]/a').click()
For this last code snippet (#4), I'm getting the following error:
selenium.common.exceptions.WebDriverException: Message: unknown error: Element <a data-id="38579" class="btn btn-lg btn-primary button select-plan">...</a> is not clickable at point (659, 14). Other element would receive the click: <div id="wpadminbar" class="">...</div>
(Session info: chrome=61.0.3163.100)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.15063 x86_64)