1

I am trying to click a link inside a table

The code is

                <a href="https://www.gmailnator.com/briceschultztmp/messageid/#17b725237c535ef2">
                    <table class="message_container">
                        <tbody>
                            <tr>
                                <td>Discord <[email protected]></[email protected]></td>
                                <td>Verify Email Address for Discord</td>
                                <td class="text-right">13 minutes ago</td>
                            </tr>
                        </tbody>
                    </table>
                </a></td></tr></tbody>

I try this code

wait = WebDriverWait(driver, 20)
wait.until(EC.element_to_be_clickable((By.XPATH, "/html/body/section/div[1]/div/div[2]/div[2]/div[2]/div/table/tbody/tr/td/a"))).click()

but its not clicking it

1 Answer 1

1

try this xpath :

//table[@class='message_container']/..

or

//a[contains(@href, 'https://www.gmailnator.com/briceschultztmp/messageid')]

and click it like this :

wait = WebDriverWait(driver, 20)
wait.until(EC.element_to_be_clickable((By.XPATH, "//a[contains(@href, 'https://www.gmailnator.com/briceschultztmp/messageid')]"))).click()
Sign up to request clarification or add additional context in comments.

Comments

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.