1

I use Selenium in Python for scraping.

The following error is displayed when I try to click button tag.

ElementClickInterceptedException: Message: element click intercepted: Element <button id="pos-list" class="menu-btn-normal">...</button> is not clickable at point

HTML

<div id="order-bar">
    <div id="order-bar-menu">
        <button id="order-list" class="menu-btn-select">orderlist</button>
        <button id="pos-list" class="menu-btn-normal">positionlist</button>
        ...

Python

pos = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="pos-list"]')))
print(pos.text)
pos.click()

print(pos.text) is printed as positionlist I expected.

How can I click this button element?

It would be appreciated if you could give me some hint.

1 Answer 1

2

Try:

pos = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, '//*[text()="positionlist"]')))
pos.click()

OR

pos = WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.XPATH, '//*[@id="order-bar"]/div/button')))
pos[1].click()

OR js execute and click()

pos = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="pos-list"]')))
driver.execute_script("arguments[0].click();", pos)
Sign up to request clarification or add additional context in comments.

3 Comments

Same error message was displayed though I tried both suggestion. Thank you for your answer.
@ SamuraiBlue, I've updated
I tried js execute and click() and it worked!! Thank you for your update!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.