|
-
May 2nd, 2005, 09:33 AM
#1
Thread Starter
Fanatic Member
Writing Text in Search textbox
hi buddies.
I have webbrowser control on my form
I want to open Google.com and then want to paste some text like
"France" in Search textbox. and then want to click
"Google Search" Button ...
So how to do it ...
Thx in advance..
-
May 2nd, 2005, 09:40 AM
#2
Re: Writing Text in Search textbox
Wouldn't it be easier to navigate to http://www.google.com/search?q=France directly? Just change the word France to whatever you're searching for. If you search for more then one word separate them with a plus sign.
-
May 2nd, 2005, 10:01 AM
#3
Re: Writing Text in Search textbox
You could also look up some examples where you can type what to search for into a textbox inside your application, and list the results in a listbox. I think the examples use INet, but I'm not too sure. Searching Planet Source Code returns a few results.
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
May 2nd, 2005, 10:12 AM
#4
Thread Starter
Fanatic Member
Re: Writing Text in Search textbox
 Originally Posted by Joacim Andersson
Wouldn't it be easier to navigate to http://www.google.com/search?q=France directly? Just change the word France to whatever you're searching for. If you search for more then one word separate them with a plus sign.
No NO no Joacim
it sounds gr8 .
but i want to get the result in my prescribed way ....
-
May 2nd, 2005, 10:13 AM
#5
Re: Writing Text in Search textbox
In that case, search for posts by EJ12N. He used the Document Object Model to accomplish tasks such as this.
Also, searching the forums for anything like this will return some results, as people have asked such things before.
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
May 2nd, 2005, 10:23 AM
#6
Re: Writing Text in Search textbox
 Originally Posted by vbPoet
No NO no Joacim
it sounds gr8 .
but i want to get the result in my prescribed way ....

Why is it so important for you that Google creates that URL for you when you can navigate to it directly?
-
May 2nd, 2005, 10:43 AM
#7
Thread Starter
Fanatic Member
Re: Writing Text in Search textbox
who is that EJ12N
and how to search particular posts ...?
hmm
Joacim because as u r saying this method is only useful for google to type accurate address.
but what i m asking
Can be used anywhere like signing in hotmail or anywhere else as well..
There may be other situations as well.
So ,,,,...
-
May 6th, 2005, 06:10 PM
#8
Thread Starter
Fanatic Member
Re: Writing Text in Search textbox
Unfortunately i have found nothing useful to my problem by searching about EJ12N's posts and others as well..
-
May 6th, 2005, 06:39 PM
#9
Re: Writing Text in Search textbox
vbPoet
Try These Posts
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
May 7th, 2005, 04:24 AM
#10
Thread Starter
Fanatic Member
Re: Writing Text in Search textbox
-
May 7th, 2005, 05:18 AM
#11
Re: Writing Text in Search textbox
Well as a general way of doing it, first you will need to know the name of the input box. You can usually get this from the address generated. In Google's case the address is
www.google.com/search?q=
All the values submitted from the form (the search page) have an equals sign after them. In this case the search query is in a field called "q" as you can probably work out from q=. If there are more values sent then they are separated by ampersands, e.g. "?q=Something&start=0".
That means that on the search page, the input box's name is also "q". You can also get this by looking at the source code for the page.
Code:
<input maxLength=256 size=55 name=q value="">
Now to fill that in you will need to use the DOM to find that field and insert a value. How you do that I'm not quite sure, but it can definitely be done. TheVader would know
-
May 7th, 2005, 08:05 AM
#12
Thread Starter
Fanatic Member
Re: Writing Text in Search textbox
 Originally Posted by penagate
Well as a general way of doing it, first you will need to know the name of the input box. You can usually get this from the address generated. In Google's case the address is
www.google.com/search?q=
All the values submitted from the form (the search page) have an equals sign after them. In this case the search query is in a field called "q" as you can probably work out from q=. If there are more values sent then they are separated by ampersands, e.g. "?q=Something&start=0".
That means that on the search page, the input box's name is also "q". You can also get this by looking at the source code for the page.
Code:
<input maxLength=256 size=55 name=q value="">
Now to fill that in you will need to use the DOM to find that field and insert a value. How you do that I'm not quite sure, but it can definitely be done. TheVader would know 
It sounds gr8 for problems in which querystring is used .. like in GOOGLE
but what is to do if i want to treat www.hotmail.com
like
typer username & password automatically and when it will display the account .. Then click on INBOX button .....?
-
May 7th, 2005, 08:15 AM
#13
Re: Writing Text in Search textbox
Well as a rule of thumb for all pages with forms (text boxes, submit buttons etc.) you need to take a peek at the HTML source code to find out the name of each input element. In the case of Hotmail that would be the username and password field, and then of course you also need to find the login button. The Inbox I think is a link (My Messages?).
edit: Never finished what I was going to say. You can use the DOM from VB to set the text of the elements (if you know their names) and I'm pretty sure you can also submit a form.
-
May 7th, 2005, 08:24 AM
#14
Thread Starter
Fanatic Member
Re: Writing Text in Search textbox
Ok penagate
where can i find help about DOM using Vb6...?
-
May 7th, 2005, 09:05 AM
#15
Re: Writing Text in Search textbox
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
|