Results 1 to 2 of 2

Thread: Entering text in textbox of webbrowser

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    1

    Entering text in textbox of webbrowser

    I looked at so many tutorials and i can't find any

    I am trying to make a program that uses internet controls and navigate go to google then type in the google textbox and press search. How would i do this?

  2. #2
    Addicted Member Xiphias3's Avatar
    Join Date
    Jan 2009
    Location
    Clarendon, Jamaica
    Posts
    188

    Re: Entering text in textbox of webbrowser

    Here you go.

    Relevant HTML:
    Code:
    <input name=source type=hidden value=hp><input autocomplete="off" maxlength=2048 name=q size=55 class=lst title="Google Search" value="">
    Relevant Code:
    vb Code:
    1. ' Go through the Forms and look for the Google Saerch text box
    2.     For Each oForm In WebBrowser1.Document.Forms
    3.         For Each oEle In oForm.elements
    4.             ' Can we enter textwith this element?
    5.             If (oEle.isTextEdit) Then
    6.                 ' Is this the Google Search textbox?
    7.                 If (oEle.Title = "Google Search") Then
    8.                     ' Set the text box value
    9.                     oEle.Value = "I AM XIPHIAS3!!!111"
    10.                     ' Do the saerch by submitting the Form
    11.                     Call oForm.submit
    12.                     ' Exit the Loop structures by setting oEle to Nothing
    13.                     ' One "Exit For" wouldnt work as we're nested ("Form" as well as "Form Elements")
    14.                     Set oEle = Nothing
    15.                     Exit For
    16.                 End If
    17.             End If
    18.         Next oEle
    19.         If (oEle Is Nothing) Then Exit For
    20.     Next oForm
    Attached Files Attached Files
    Last edited by Xiphias3; Sep 13th, 2009 at 01:25 PM.

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