6

So I'm trying to download a certain link of a webpage but each time i run the code i get an AttributeError: 'Webdriver' object has no attribute 'findElement'. I'm using selenium and python. here is my code

import selenium 
from selenium import web driver

driver = web driver.Firefox()
driver.implicitly_wait(5)
driver.get("The web site I'm trying to take link from")
driver.findElement(By.partialLinkText("DEV.tgz")

Can anybody help me to why I am getting this error

1 Answer 1

7

You need to use find_element_by_partial_link_text() here:

element = driver.find_element_by_partial_link_text('DEV.tgz')

Or, alternatively, you can take find_element() with By approach:

from selenium.webdriver.common.by import By
element = driver.find_element(By.PARTIAL_LINK_TEXT, 'DEV.tgz')
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.