hi all,
im aiming to open an instance of ie in my vb application. i have added brwWebBrowser control to it but how do i get it to navigate to the web page i want??
any thoughts would be greatly received
ps great site!!!!!!!!!!!!!!!!
Printable View
hi all,
im aiming to open an instance of ie in my vb application. i have added brwWebBrowser control to it but how do i get it to navigate to the web page i want??
any thoughts would be greatly received
ps great site!!!!!!!!!!!!!!!!
try
If not some one will correct meVB Code:
WebBrowser1.Navigate "http://www.vbforums.com"
thanks that did it!!!
Great,
Please don't forget to add a check mark and (resolved) to the title of your post.
ok so the webpage opens, great!
but now i wanna get it to set focus then send keys to use the search engine. so far its not working!
my code
VB Code:
If Len(StartingAddress) > 0 Then 'try to navigate to the starting address WebBrowser1.Navigate "http://www.hmv.co.uk" WebBrowser1.SetFocus SendKeys "{TAB 8}", True ' tab 8 times SendKeys "hello" SendKeys "{ENTER}", True End If
I believe someone asked this for Google the other day. Instead of typing "hello" into the box, why not navigate to the actual search page, and just fill in the search parameters? For Example:
PhreakVB Code:
WebBrowser.Navigate2 "http://www.google.com/search?q=Hello" 'or WebBrowser.Navigate2 "http://www.google.com/search?q=Visual+Basic+6+Tutorials"
You can take a look at using the DOM way of doing things.
http://www.vbforums.com/attachment.p...chmentid=36095
Hello parker,
Its better to do it the QueryString instead of writing too much code using DOM.
If you need any spoon feeding on how to do that:
Open a browser and goto your desired search engine website
type the URL
type "test" in the search box and press Enter
now after you get the search result, copy the URL:
Note the bolded "test". The text we typed for. So, all we got to do is to replace with the search string you wantCode:http://www2.hmv.co.uk/hmvweb/simpleSearch.do?pGroupID=-1&simpleSearchString=test&primaryID=-1&btnSearchGo.x=13&btnSearchGo.y=9
Here is the code:
VB Code:
MySearchString = "hi there" sURL = "http://www2.hmv.co.uk/hmvweb/simpleSearch.do?" & _ "pGroupID=-1&simpleSearchString=" & Replace(MySearchString, " ", "+") & _ "&primaryID=-1&btnSearchGo.x=13&btnSearchGo.y=9" WebBrowser1.Navigate2 sURL
you might optionally write a function to encode the search string in the %XX format.
HTH
Neo