Solved

Clicking a button within HTML page

Posted on 2004-04-22
11
249 Views
Last Modified: 2010-05-02
I have the handle to the class: "Internet Explorer_Server"

I don't know if it will help, but I want to be able to get my application to find an edit within a webpage, type some text in it and then click a button with "Search" as its caption on the web page.

Is this possible? And how would I go about doing this?

Thanks
0
Comment
Question by:PhilAI
  • 5
  • 2
  • 2
  • +2
11 Comments
 
LVL 11

Expert Comment

by:bingie
ID: 10894689
What is the URL of the page where the button is?
0
 
LVL 2

Expert Comment

by:gimmeadrink
ID: 10895168
This question was answered here:

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20962877.html by Aelatik

Hope this helps
0
 
LVL 11

Expert Comment

by:bingie
ID: 10895182
Some ways to do this,

Without components or references (example, thanks to ZZZZZOC):

Private Sub Form_Load()
    Dim oIE As Object, sURL As String
    sURL = "http://login.passport.net/uilogin.srf?id=2"
    Set oIE = CreateObject("InternetExplorer.Application")
    oIE.Visible = True
    Call oIE.Navigate("www.hotmail.com")
    Do Until oIE.LocationURL = sURL And oIE.readystate = 4
        DoEvents
    Loop
    oIE.document.Form1.login.Value = "email@email.com"  'replace with your id
    oIE.document.Form1.passwd.Value = "pass"  'replace with your password
    oIE.document.Form1.submit1.Click
End Sub

Or With the webbrowser component:

Webbrowser1.Document.All("Login").Click

If you want to provide the URL, it would help.

Bingie
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 2

Expert Comment

by:gimmeadrink
ID: 10895195
yeah, i think that was the same question, but for some reason, its not going to be the one that gets accepted...
heh, whatever works i guess.
0
 
LVL 5

Expert Comment

by:amit1978
ID: 10897169
looking for same
0
 
LVL 6

Author Comment

by:PhilAI
ID: 10900331
Not got the address with me here, so I'll let you guys know when I have finished work what the address is.

It is not a search button, but the 'Place Bid' I want now, decided I didn't need the search function. I want to be able to automatically place bids on eBay. So, the address depends on the item number - just pick any item on the UK eBay website as an example, and that would be feasible.

Thanks all!
0
 
LVL 6

Author Comment

by:PhilAI
ID: 10900344
0
 
LVL 6

Author Comment

by:PhilAI
ID: 10902271
OK, is it possible to navigate through the page when it is in IEXPLORE.EXE

i.e. I have the page open in the browser, and want to connect to that instance?
0
 
LVL 6

Author Comment

by:PhilAI
ID: 10902350
OK, I have found out that this can do it, but what if I want a specific window?

If IEeBayItem Is Nothing Then Set IEeBayItem = GetObject(, "InternetExplorer.Application")

I may have more than one MS IE window open at a time...
0
 
LVL 14

Accepted Solution

by:
aelatik earned 125 total points
ID: 10906434
You can loop trhough all IE instances and connect to the one you like with this code :

    Dim IE, WIN
    Set IE = CreateObject("internetexplorer.application")
    Set WIN = CreateObject("shell.application")
    For Each IE In WIN.Windows
        ' check if this is the URL you want
        If InStr(1, IE.document.Title, "eBay", vbTextCompare) > 0 Then
            ' Do your stuff with IE. this is the instance you need.
        End If
    Next IE
0
 
LVL 6

Author Comment

by:PhilAI
ID: 10907037
Spot on aelatik! I knew what I wanted to do, just didn't know how exactly.

Thanks for all your help.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question