WebBrowser Trying to Download JS files from Webpage

Discussion in 'Visual Basic .NET' started by mixing, Aug 16, 2014.

  1. mixing

    mixing Regular Member

    Jan 18, 2014
    Likes Received:
    Hey everyone..I'm having a problem here which I hope someone can help me with.

    I've been working on a small traffic bot which will basically connect to a proxy, then visit a webpage. Everything was working fine by doing this via HTTPwebrequest, but the hits weren't showing up in Google Analytics. After reading more I figured out this was because there was never any JS being parsed (no calls actually hitting the page content).

    I decided to begin doing the process through a webbrowser instead to fix that issue and that seamed to fix it, except one strange issue. When trying to hit a website I always get prompted to download any JS file from the source. I've set ScriptErrorsSurppressed to True and I don't seam to get any errors or anything of the like, it just always prompts me to download the JS files. Any idea how to fix this?

    Or an even better solution would be if someone knows a way to trigger GA via an httpwebrequest!
  2. manchesterfan

    manchesterfan Junior Member

    Jun 19, 2013
    Likes Received:
    Manchester (duh!)
    I think that webbrowser use InternetExplorer as browser. Did u tried to set up in IE those settings ?
  3. zohar

    zohar Newbie

    Jun 24, 2014
    Likes Received:
    First things first, you need to set registry keys in order to get the IE version right. You might be running the control on a computer with IE 10+ installed, but the webbrowser control may still be functioning in IE8 compatibility mode. You can fix all of this through the registry. Google this.

    Second, you can catch all site links with the OnNavigate event of the webbrowser control. If you have certain issues, you can simply set the event's e.Cancel variable to True, so that IE will not proceed with the request. etc etc.
    Last edited: Oct 23, 2014