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

What language for making a web bot (filling out forms and such)?

Discussion in 'General Programming Chat' started by paulm, Jan 29, 2011.

  1. paulm

    paulm Newbie

    Joined:
    Jan 29, 2011
    Messages:
    4
    Likes Received:
    0
    Apologies for my first post being a question but I've lurked around here a lot though : )

    I'm looking to create a web bot that will help me register at sites. It will be very simple and it will not automate anything over many sites running on the same platform.
    I'm simply looking to create seperate instructions for each and every website that I've chosen to add to the bot. To begin with it will just go to a registration url and fill in username from some variable and password and something I've told it to fill out so I can run the bot again and again to create a new account.
    It will also have to stop somewhere to let me fill in stuff it can't fill out (captchas maybe).

    So with what would I create this. And I would make it run through my browser right?
    I know no programing but I'd be willing to learn PHP or C++. I know completely different things but would either of those work?

    Also what will the bot need to identify the username spots, password forms, ect? I could do something simple like make it run through the browser and make it tap tab X many times to get to the field and then fill it. So completely manual for each website then of course.

    Any suggestions would be helpful for what I should use.
    Thank you!
     
  2. wickedguy

    wickedguy Supreme Member

    Joined:
    Jul 22, 2009
    Messages:
    1,402
    Likes Received:
    1,379
    Location:
    BHW--> South Africa
    Home Page:
    use PHP bro, that's what I use :D
     
    • Thanks Thanks x 1
  3. paulm

    paulm Newbie

    Joined:
    Jan 29, 2011
    Messages:
    4
    Likes Received:
    0
    Dude that's already very helpful thanks! It gets me on track because I'm so clueless.
    So with PHP where do you run it from? Do you have it on some server?

    I need to be able to change ip's but only between runs. You know so when I'm creating an account at the same site again they won't notice. Probably with a proxy so I'm thinking it would be easiest to run it through my browser.
     
  4. RuiGomes

    RuiGomes BANNED BANNED

    Joined:
    Jun 12, 2010
    Messages:
    700
    Likes Received:
    238
    If you have no programming knowledge you can make some simple stuff with iMacros. If you do have programming knowledge, then the scripting edition of iMacros is really powerful.

    I heard that uBot is pretty good, but it seems quite unknown and unsupported. I've never used it though, so can't say if it's good or bad.
     
    • Thanks Thanks x 1
  5. paulm

    paulm Newbie

    Joined:
    Jan 29, 2011
    Messages:
    4
    Likes Received:
    0
    iMacros seems good so I might check it out. I wouldn't really say I have programming knowledge but I had tried some PHP stuff like creating simple password forms on web pages.
    But since I only learned that I am now confused how you make the same language fill out other peoples forms across the web. And where does it run from?
     
  6. wickedguy

    wickedguy Supreme Member

    Joined:
    Jul 22, 2009
    Messages:
    1,402
    Likes Received:
    1,379
    Location:
    BHW--> South Africa
    Home Page:
    ok, here's some code for you to post to a form on a site to get you started

    PHP:
    <?

    curl_post('http://examplesitewithform','name=james&email=emailaddress');


    function 
    curl_post($URL,$poststring) {
    $ch=curl_init();
    curl_setopt ($chCURLOPT_URL,$URL);
    curl_setopt ($chCURLOPT_POSTFIELDS$poststring);
    curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
    curl_setopt($chCURLOPT_CONNECTTIMEOUT25);
    curl_setopt($chCURLOPT_TIMEOUT25);
    $data=curl_exec ($ch);
    flush();     
    curl_close($ch);
    if (
    $data) return $data;
    else return 
    false;
    }
    ?>
     
    • Thanks Thanks x 1
  7. paulm

    paulm Newbie

    Joined:
    Jan 29, 2011
    Messages:
    4
    Likes Received:
    0
    Thanks wickedguy! I'm reading more about PHP cURL right now.
     
  8. mazgalici

    mazgalici Supreme Member

    Joined:
    Jan 2, 2009
    Messages:
    1,489
    Likes Received:
    881
    Home Page:
    I also use php because linux hosting is cheap and fast. Also I make the script to run on multiple machines in the same time
     
    • Thanks Thanks x 1
  9. RottenYellow

    RottenYellow BANNED BANNED

    Joined:
    Sep 10, 2010
    Messages:
    68
    Likes Received:
    16
    Instead of running scripts on multiple machines, use threads and make single script control multiple threads.

    To OP: Learn C#. It's fairly simple and you can get Visual C#, which allows you to easily create GUI. You can make sick bots with it. PHP might be easier for you to understand and get started in coding. I would go def with any of the C's on what you're doing. I made recently a similar bot, that creates accounts on popular forum platforms using php (watch out BHW :D), but I'm going to rewrite it as an application, php is not really the right kind of tool to make 'heavy' bots with.

    To find a 'button', 'textbox' or any controls/tags/values on a page, you will need to learn Regular Expressions. Also you will need some kind of http sniffer to see what information is being sent between browser/server. HttpFox is pretty good (FF plugin).

    If you literally want to make a bot, that fills up forms and clicks links in browser - WatIN is a library that lets you do exactly that! But no multi-threading obviously, since it actually controlling your browser.
     
    Last edited: Feb 7, 2011
  10. blakamia

    blakamia Junior Member

    Joined:
    Jan 25, 2010
    Messages:
    162
    Likes Received:
    343
    C# all the way! Also, you can multithread Watin! You just have to be a skilled coder ;)
     
  11. RottenYellow

    RottenYellow BANNED BANNED

    Joined:
    Sep 10, 2010
    Messages:
    68
    Likes Received:
    16
    Care to explain? :D
     
  12. Autumn

    Autumn Elite Member

    Joined:
    Nov 18, 2010
    Messages:
    2,197
    Likes Received:
    3,041
    Occupation:
    I figure out ways to make money online and then au
    Location:
    Spamville
    I vote PHP / Curl. Great for automation, lots of examples out there. Easy proxy handling. You can run it from a server or your PC. When you're running it from your PC, you have the option of running it using the apache webserver running on your PC (ie using web pages served from your own PC to control your scripts) or from the command line (ie the windows command prompt, which is better for real automation).
     
  13. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,227
    Occupation:
    Retired
    Location:
    Old Peoples Home
    I'll throw something different into the pot - Perl with Mechanize, nice and easy.
    Not a lot of difference between that and PHP / CURL so pick what you are more comfortable with (PHP will probably be easier in the long run)

    At the moment I am getting to grips with Ubot which is easy enough to bash out a few easy bots, if its a larger project things get a bit tougher but I'll get there :)
     
  14. Autumn

    Autumn Elite Member

    Joined:
    Nov 18, 2010
    Messages:
    2,197
    Likes Received:
    3,041
    Occupation:
    I figure out ways to make money online and then au
    Location:
    Spamville
    I would argue that there isn't much new stuff being written in Perl, whereas experience with PHP will apply to any number of web development things a person might get in to in the near future.

    If I wasn't going to do it with PHP I'd do it with Python (which I've been learning lately using Open Courseware), because it's a very clean and fully featured language with a great standard library for scraping, parsing and spamming.
     
  15. blakamia

    blakamia Junior Member

    Joined:
    Jan 25, 2010
    Messages:
    162
    Likes Received:
    343
    Dynamically spawn multiple Webbrowser controls, then associate each one with a Watin instance. Bam, multithreading :)

    Pretty hard to figure out tho, lol :D
     
  16. neu009

    neu009 Jr. VIP Jr. VIP Premium Member

    Joined:
    Jul 29, 2009
    Messages:
    1,021
    Likes Received:
    272
    if u lack coding knowledge go for imacros. for simple registering etc its going to be a piece of cake to use it. its quite powerful and once u know any other language u can use it with imacros.
     
  17. zelma143

    zelma143 Power Member

    Joined:
    Jun 25, 2010
    Messages:
    571
    Likes Received:
    37
    Occupation:
    PHP programmer,Bot maker,iMacro script maker
    iMacro will be easiest way...
     
  18. CYKen

    CYKen Newbie

    Joined:
    Feb 14, 2011
    Messages:
    17
    Likes Received:
    0
    PHP dude.. Awesome language
     
  19. jason-l

    jason-l Regular Member

    Joined:
    Feb 21, 2011
    Messages:
    281
    Likes Received:
    83
    no real need to code.. just use something like imacros or winautomation.
     
  20. deancow

    deancow Power Member

    Joined:
    Jul 8, 2009
    Messages:
    653
    Likes Received:
    235
    I would advise zennoposter, theres tonnes of stuff you can do with it and it's extremely easy to teach to signup to web 2.0 sites etc, I've already used it to create a twitter bot with auto posting, following on keywords it researches.
    The cheapest version is only $50!
    Only downside is lack of documentation and videos but you should be able to work it out., either way it's easier than learning a whole new language