How to click a link in WebDriver using Python?

<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?

Answers


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()

I'd have used:

driver.find_element_by_link_text("Click here!").click()

Need Your Help

At what rate are the number of cores per CPU increasing?

parallel-processing

I'm designing a system that will be on-line in 2016 and run on commodity 1U or 2U server boxes. I'd like to understand how parallel the software will need to be so I'd like to estimate the number of

How do I checkout files under Perforce from within Emacs?

version-control emacs file perforce

I use Perforce for source control at work and I want to 'open for edit' files that under source control from within Emacs.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.