Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Clicking a button within HTML page

Posted on 2004-04-22
11
Medium Priority
?
254 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 500 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

618 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