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

Button click problem C#

Discussion in 'C, C++, C#' started by MisterNick, Oct 12, 2016.

  1. MisterNick

    MisterNick Registered Member

    Joined:
    Oct 22, 2014
    Messages:
    73
    Likes Received:
    53
    Occupation:
    Programmer
    Location:
    Tbilisi,Georgia
    Hello,

    I'm trying to create a following bot on specific website. When i try to click on "Follow" button by innertext or class name nothing happens, but when i open usual chrome browser and perform that operation it works fine. Any suggestion what it is? or how to fix that?

    Thanks
     
  2. astrodream

    astrodream Newbie

    Joined:
    Sep 5, 2016
    Messages:
    7
    Likes Received:
    0
    post more details. how you trying to do this?
     
  3. Tomothy Jackson

    Tomothy Jackson Junior Member

    Joined:
    Jun 6, 2017
    Messages:
    102
    Likes Received:
    11
    Gender:
    Male
    Please post more details. Did you use WebBrowser to open the website? Try this:
    Code:
    var links = webBrowser1.Document.GetElementsByTagName("a");
    foreach (HtmlElement link in links)
    {
       if (link.GetAttribute("className") == "show1")
       {
           //do something
       }
    }
     
  4. chimpcoder

    chimpcoder Newbie

    Joined:
    Sep 13, 2016
    Messages:
    23
    Likes Received:
    3
    Gender:
    Male
    You should specify either you are using webbased apps or desktop apps.
     
  5. ThatWeb20Guy

    ThatWeb20Guy Registered Member

    Joined:
    Aug 21, 2017
    Messages:
    67
    Likes Received:
    13
    It might be behind some JS. Which browser emulator are you using? Try dumping the source to disk where the problem occurs. You may find there are no elements visible, at least not the ones you want.
     
  6. Chonchonts

    Chonchonts Newbie

    Joined:
    Jul 2, 2012
    Messages:
    15
    Likes Received:
    1
    I have this problem with Selenium and search google button.
    Some buttons on the web are not button html tag but div or input tags with javascript function.
    So you need to simulate a click with your bot at the position of the button.