Results 1 to 15 of 15

Thread: Writing Text in Search textbox

Hybrid View

  1. #1

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    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..

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    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.

  3. #3
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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

  4. #4

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    Re: Writing Text in Search textbox

    Quote 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 ....

  5. #5
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Writing Text in Search textbox

    Quote 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?

  7. #7

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    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 ,,,,...

  8. #8

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    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..

  9. #9
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    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."


  10. #10

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    Re: Writing Text in Search textbox

    Quote Originally Posted by Mark Gambo
    vbPoet

    Try These Posts

    vBulletin Message

    Sorry - no matches. Please try some different terms.


  11. #11
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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

  12. #12

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    Re: Writing Text in Search textbox

    Quote 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 .....?

  13. #13

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    Re: Writing Text in Search textbox

    Ok penagate
    where can i find help about DOM using Vb6...?

  14. #14
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width