1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Stuck While Developing addmefast bot in python !

Discussion in 'Other Languages' started by Breakdown, Jan 29, 2015.

  1. Breakdown

    Breakdown Newbie

    Joined:
    Apr 18, 2014
    Messages:
    42
    Likes Received:
    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 :)
     
  2. Chlenix

    Chlenix Newbie

    Joined:
    Nov 3, 2013
    Messages:
    30
    Likes Received:
    5
    Try
    Code:
    find_element_by_css_selector
    instead of
    Code:
    find_elements_by_css_selector
    is a class or id right? So precede it with . or # respectively
     
    Last edited: Jan 29, 2015
  3. Breakdown

    Breakdown Newbie

    Joined:
    Apr 18, 2014
    Messages:
    42
    Likes Received:
    2
    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>
    
    
     
  4. Chlenix

    Chlenix Newbie

    Joined:
    Nov 3, 2013
    Messages:
    30
    Likes Received:
    5
    The problem is also your selector, read my previous reply to the end.
     
  5. Breakdown

    Breakdown Newbie

    Joined:
    Apr 18, 2014
    Messages:
    42
    Likes Received:
    2
    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!
     
  6. maxibaby

    maxibaby Junior Member

    Joined:
    Apr 20, 2013
    Messages:
    103
    Likes Received:
    39
    Occupation:
    Student
    Location:
    Venezuela
    Hey, i'd love to know more about your proyect.
    :)
     
  7. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    990
    Likes Received:
    175
    Location:
    not in Past
    its always better to use find_element_by_xpath
     
  8. k3m02

    k3m02 Newbie

    Joined:
    May 6, 2015
    Messages:
    6
    Likes Received:
    1
    once you have completed development, i recommend you switch from FireFox to phantomjs
     
  9. Porfoore

    Porfoore Newbie

    Joined:
    Nov 8, 2012
    Messages:
    19
    Likes Received:
    1
    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.