AttributeError: 'WebDriver' object has no attribute 'find_elements_by_xpath'
vkulaganathan opened this issue · comments
I get the following error: python3 eagle-eye.py
Traceback (most recent call last):
File "eagle-eye.py", line 229, in <module>
main(skipFB=args.skipfb, FBUrls=[], jsonRep=jsonRepFile, dockerMode=aDocker, dockerName=aName)
File "eagle-eye.py", line 99, in main
f.grabData()
File "/EagleEye/EagleEye/grabber/facebook.py", line 25, in grabData
profile_img_links = driver.find_elements_by_xpath("//a[@class='_2ial']")
AttributeError: 'WebDriver' object has no attribute 'find_elements_by_xpath'
I had the same problem, but to be clear I tried to install EagleEye on Ubuntu 22.10 with webdriver-manager==3.8.4.
The functions of this API have changed, it is now find_element() and its plural find_elements() and they both need arguments. In your case it would become:
profile_img_links = driver.find_elements("xpath", "//a[@class='_2ial']")
others include:
image = e.find_element(By.TAG_NAME, "img") link_name = self.driver.find_elements(By.TAG_NAME,'a')
You need to adjust both google.py and facebook.py. After that comes the need to adjust the xpaths.