Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27516

VS 2010 Webbrowser questions

$
0
0
I'm getting very frustrated and Google has not been kind to me.

1. I have my simple program open an external program called Tor which is a proxy browser. Really, this is just one line of code. Tor in turn opens a Firefox stub called TorBrowser. I'm trying to navigate to a webpage using this Firefox stub, but when I use the following code (see below), it opens up Google in my default browser which is chrome.

Code:

Process.Start("www.google.com")
2. On a related issue, I thought if I closed all open browsers, that this would work, but it didn't. Regardless, is there a way to check for open browsers and close them? I read on Google some shell commands that work if you know the windows name, but Chrome's has no name that I can see, so I'm not sure how to do this.

2. The next issue I'm having is I'm not entirely sure how to make the program wait until the Firefox stub has fully loaded before trying to go to Google. Before I put a 60-second timer in my program, it would open Google in Chrome about 20-30-second before Firefox even loaded up. Is using timers the best method, or is there a way to verify the web browser is up before applying the code?

4. Once I finally figure out how to get this working, how might I pass my code currently written for webbrowser1 to the Firefox stub? For example:

Code:

Private Sub btnPopulate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPopulate.Click

          Try

                WebWindow.Show()
                WebWindow.WebBrowser1.Navigate("http://www.somewebsite.com/")

                Call TTDelay(3)

                  Dim btnClick As HtmlElement = WebWindow.WebBrowser1.Document.GetElementById("radiogroup0")
                If btnClick IsNot Nothing Then
                    btnClick.InvokeMember("click")
                End If

                Call TTDelay(3)

                Dim stVO As String = lstEntries.Items(0).ToString()
                    WebWindow.WebBrowser1.Document.GetElementById("promptInput_68073").SetAttribute("value", stVO)

Catch ex As NullReferenceException
             
            End Try

        End Sub

I'm sure these are all really simple questions with really simple answers and I hope you guy's are getting upset with me for asking so many dumb questions (there are no dumb questions, only dumb people :bigyello:). I'm going to finish my vb.net learning books right after I finish this project I've been working on, which is why I'm jumping ahead of myself, unfortunately. I sincerely thank you for any answers ahead of time.

Viewing all articles
Browse latest Browse all 27516

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>