0

I've been using Python's Selenium bindings with PyCharm CE for three years now and never had any problems with its functions.

But now I'm encountering a very weird error when trying to use find_element_by_link_text as in

browser.find_element_by_link_text("Administration").click()

The error reads as followed:

selenium.common.exceptions.JavascriptException: Message: javascript error: this.each is not a function

Other find_element_by functions work perfectly fine.

After updating all my packages including selenium to 4.0 I received this warning in addition to the above:

UserWarning: find_element_by_* commands are deprecated. Please use find_element() instead
  warnings.warn("find_element_by_* commands are deprecated. Please use find_element() instead")

I downgraded selenium to 3.141.0 again, but then I just receive the this.eacherror again without any warnings.

I also tried other different approaches given by selenium.dev such as

browser.find_element(By.LINK_TEXT, value="Administration")

but they don't seem to work either.

What has changed? What do I have to change? Why do all other similar find_element functions like id/xpath/visible_text/etc. work? I'm at my wits' end, and I don't want to rewrite all my find_element_by_link_text calls. :(

1

1 Answer 1

1

The function finally works with Chrome 83 Beta and Chromedriver 83, and it looks like the problem was caused by the older Chromedriver version, incorrectly calling prototype.js.

Patch notes for version 83:

"Updated Chromedriver to work correctly with prototype.js."

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.