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

Using webbrowser control to automate tasks?

Discussion in 'C, C++, C#' started by mrpega, Jun 28, 2009.

  1. mrpega

    mrpega Jr. VIP Jr. VIP

    Joined:
    Sep 19, 2008
    Messages:
    378
    Likes Received:
    88
    Is using the web browser control to automate tasks or is using httpwebrequest and the hard-coding method better way to achieve an efficient bot?

    i heard that the wb control is slower but I don't see why is it slow..:confused:
     
  2. RandR

    RandR Registered Member

    Joined:
    May 18, 2009
    Messages:
    75
    Likes Received:
    25
    Home Page:
    You would be much better off with raw HTTPWebRequests.
    The WebBrowser control is CPU intensive because it's something like a limited version of IE...All page loads are processed, images loaded, etc., etc.
    With a WebRequest you don't load anything, you just POST and GET (text/HTML).
     
  3. zozor

    zozor Junior Member

    Joined:
    Dec 24, 2008
    Messages:
    113
    Likes Received:
    70
    The webbrowser control SEEMS very easy to use. But if you want to multi thread, use proxy,fill forms etc its a PAIN IN THE ASS
     
  4. SEO20

    SEO20 Elite Member

    Joined:
    Mar 25, 2009
    Messages:
    2,017
    Likes Received:
    2,260
    For small projects and getting things done I simple use u-bot to my scripting needs.

    If you want to sell products you can't go this route off cause :)
     
  5. myvideoke

    myvideoke Newbie

    Joined:
    Feb 7, 2009
    Messages:
    17
    Likes Received:
    6
    So if I want to fill up a form, how can I use the WebRequest class?
     
  6. myvideoke

    myvideoke Newbie

    Joined:
    Feb 7, 2009
    Messages:
    17
    Likes Received:
    6
    I figured out how to fill up the form using the WebClient.UploadValues method but I'm not sure how to get the resulting next page after submitting the value. Anybody?
     
  7. Bacanze

    Bacanze Junior Member

    Joined:
    Nov 12, 2008
    Messages:
    150
    Likes Received:
    49
    Occupation:
    Uni student
    Location:
    UK
    Read up on the WebClient class.
     
  8. lonzie

    lonzie Newbie

    Joined:
    Jun 24, 2009
    Messages:
    24
    Likes Received:
    83
    Webbrowser control is fine for filling in forms, but you are right for the multi threading, proxy etc it is terrible. To use proxy connection with the control requires the global IE proxy settings to be changed which is a bit of a pain in the backside.
     
  9. Money Man

    Money Man Elite Member

    Joined:
    Apr 2, 2009
    Messages:
    1,701
    Likes Received:
    752
    Occupation:
    Internet Marketer, Advertisement, Programmer, SEO
    Wait, are you talking about the WebBrowser control in VB6?

    If so, there is no need to fill in forms. If you are in fact speaking about VB6, please reply and let me know and I will reply with some code and a little tutorial that will make things A LOT easier.

    I prefer passing headers with the Winsock control, and then manipulating the data returned in DataArrival, but in some instances I need to use the WebBrowser control.

    Also, just a tip, you can disable images within IE. This makes things A LOT faster unless you need the images for Captcha or what have you. If you do not know how to disable images in IE, either search Google or I will cover it in my reply.
     
  10. daminkz

    daminkz Newbie

    Joined:
    Dec 22, 2009
    Messages:
    5
    Likes Received:
    0
    Just a little insight - you cannot use the HTTPWebRequest Class if javascript manipulation is involved.
     
  11. SEO20

    SEO20 Elite Member

    Joined:
    Mar 25, 2009
    Messages:
    2,017
    Likes Received:
    2,260
    My new toy is AutoIT - works great.
    You should check it out:
    http://www.autoitscript.com/autoit3/index.shtml

    It's free too.