Davi Leo
Davi Leo

Reputation: 84

Python Webdriver Unable to locate the xpath in facebook for Liked and shared button in pages

i am writing a code on python by using selenium that login into Facebook and Like a Facebook page i requested. it works to login but after opening the Facebook page i requested, it wont like the page it shows error saying 'Attribute-errorenter image description here: 'list' object has no attribute 'click''. maybe it didn't get the correct xpath ,any ideas?

Upvotes: 0

Views: 49

Answers (2)

Sami Mulat
Sami Mulat

Reputation: 48

use chropath extension in chrome

Upvotes: 2

Svetlana Levinsohn
Svetlana Levinsohn

Reputation: 1556

See line 27 of your code: you are using find_elementS instead of find_element.

find_elements always returns a list of elements, so when you are trying to do like.click(), it fails. Try using find_element_by_xpath at the line 27 of your code, it should work.

Good luck!

Upvotes: 1

Related Questions