|
-
May 4th, 2005, 02:19 AM
#1
Thread Starter
Junior Member
internet explorer
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!!!!!!!!!!!!!!!!
-
May 4th, 2005, 02:43 AM
#2
Fanatic Member
Re: internet explorer
try
VB Code:
WebBrowser1.Navigate "http://www.vbforums.com"
If not some one will correct me
-
May 4th, 2005, 02:50 AM
#3
Thread Starter
Junior Member
Re: internet explorer
-
May 4th, 2005, 03:10 AM
#4
Fanatic Member
Re: internet explorer
Great,
Please don't forget to add a check mark and (resolved) to the title of your post.
-
May 4th, 2005, 03:10 AM
#5
Thread Starter
Junior Member
Re: internet explorer
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
-
May 4th, 2005, 03:22 AM
#6
Re: internet explorer
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:
VB Code:
WebBrowser.Navigate2 "http://www.google.com/search?q=Hello"
'or
WebBrowser.Navigate2 "http://www.google.com/search?q=Visual+Basic+6+Tutorials"
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
May 4th, 2005, 03:39 AM
#7
Re: internet explorer
You can take a look at using the DOM way of doing things.
http://www.vbforums.com/attachment.p...chmentid=36095
-
May 4th, 2005, 07:14 AM
#8
Lively Member
Re: internet explorer
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:
Code:
http://www2.hmv.co.uk/hmvweb/simpleSearch.do?pGroupID=-1&simpleSearchString=test&primaryID=-1&btnSearchGo.x=13&btnSearchGo.y=9
Note the bolded "test". The text we typed for. So, all we got to do is to replace with the search string you want
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|