0
<tr><td class=wb><a href="javascript:void(fight())" style='text-decoration:none'><b>Click here!</a></td></tr>

Hi, how to click this url?

2 Answers 2

1

I'd have used:

driver.find_element_by_link_text("Click here!").click()
Sign up to request clarification or add additional context in comments.

Comments

0

I'm not sure, but try this:

elements = driver.find_elements_by_tag_name("td")
for element in elements:
    if element.text == "Click here!":
        element.click()

Or:

elements  = find_elements_by_class_name("wb")
for element in elements:
    if element.text == "Click here!":
        element.click()

1 Comment

You shouldn't try to get all the elements. Instead, you should only retrieve the first element, which you can easily do with a single line of code.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.