Stuck While Developing addmefast bot in python !

Breakdown

Newbie
Joined
Apr 18, 2014
Messages
42
Reaction score
2
Hello everyone,

I was hoping you could help me out in some issues i have encountered.
New into this whole scheme but i am trying to build a simple web-bot in python for addmefast but i am currently STUCK on the step where the bot is supposed to
click on the Like button inside addmefast.
I keep getting the same results

Code:
 Likebutton = driver.find_elements_by_css_selector("single_like_button.btn3-wrap > div.btn3").click()
AttributeError: 'list' object has no attribute 'click'

Part of the code that gets stuck :
Code:
driver.implicitly_wait(4)
YTlikespage = driver.get("h t t p : / / addmefast . com/free_points/youtube_likes")
Likebutton = driver.find_elements_by_css_selector("single_like_button.btn3-wrap > div.btn3").click()

Note:i spaced the addmefast link because i am not allowed to post links.

Any help would be greatly appreciated :)
 
Try
Code:
find_element_by_css_selector
instead of
Code:
find_elements_by_css_selector

single_like_button
is a class or id right? So precede it with . or # respectively
 
Last edited:
Using python 2.7

Changing from elements to element would produce the error of not even be able to find the element at all anymore
Code:
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: {"method":"css selector","selector":"single_like_button.btn3-wrap > div.btn3"}


The code that leads to the button seems to be the following.What would be the correct syntax?

Code:
<a class="single_like_button btn3-wrap" onclick="openFbLWin_2180739();"><span> </span>

<div class="btn3">Like</div>


</a>
 
The problem is also your selector, read my previous reply to the end.
 
The correct syntax for anyone who might want it is

Code:
Likebutton = driver.find_element_by_css_selector(".single_like_button .btn3").click()

Cheers!Thanks Chlenix!
 
its always better to use find_element_by_xpath
 
once you have completed development, i recommend you switch from FireFox to phantomjs
 
You can make addmefast bot much easier with imacros and CLICK X=n Y=n function. Literally, you need few minutes, to make completely working addmefast bot using imacros and CLICK function.
 
Back
Top