0

this is my first Q on this website so let me know if I have missed any important details, and thanks in advance.

I have been asked to access a website and download the results from a user-inputted form. The website asks for a username/password and once accepted, several questions which are used to generate several answers.

Since I am unfamiliar with this area I have set up a simple windows form to tinker around with websites and try to pick things up. I have used a webbrowser control and a button to use it to view the website in question.

When I try to view the website through the control, I just get script errors and nothing loads up. I am guessing I am missing certain plug-ins on my form that IE can handle without errors. Is there anyway I can identify what these are and figure out what to do next? I am stumped.

The script errors are: "Expected identifier, string or number" and "The value of the property 'setsection' is null or undefined"

Both ask if I want to continue running scripts on the page. But it works in IE and I cannot see why my control is so different. It actually request a username and password which works fine, it is the next step that errors.

I can provide screenies or an extract from the website source html if needed.

Thanks,

Fwiw my code is:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    'WebBrowser1.ScriptErrorsSuppressed = True
    WebBrowser1.Navigate("http://website.com")
    'WebBrowser1.Navigate("http://www.google.com")
End Sub
Yonabart
  • 68
  • 1
  • 11

1 Answers1

0

Thanks for Noseratio I have managed to get somewhere with this.

Even though the errors I was getting seemed to be related to some XML/Java/Whatever functionality going askew it was actually because my webbrowser control was using ie 7.0

I forced it into using ie 9 and all is now well. So, using my above example I basically did something like this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    'WebBrowser1.ScriptErrorsSuppressed = True
    BrowserUpdate()
    WebBrowser1.Navigate("http://website.com")
    'WebBrowser1.Navigate("http://www.google.com")
End Sub

Sub BrowserUpdate()
        Try

            Dim IEVAlue As String = 9000 ' can be: 9999 , 9000, 8888, 8000, 7000    
            Dim targetApplication As String = Process.GetCurrentProcess.ToString & ".exe"
            Dim localMachine As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine
            Dim parentKeyLocation As String = "SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl"
            Dim keyName As String = "FEATURE_BROWSER_EMULATION"
            Dim subKey As Microsoft.Win32.RegistryKey = localMachine.CreateSubKey(parentKeyLocation & "\" & keyName)
            subKey.SetValue(targetApplication, IEVAlue, Microsoft.Win32.RegistryValueKind.DWord)

        Catch ex As Exception
            'Blah blah here
        End Try

    End Sub
Yonabart
  • 68
  • 1
  • 11