Jump to content

IE controls with no Name or ID...


Recommended Posts

I am trying use ControlSend and ControlSet Text to enter some information in an IE form. I was also hoping to make a selection from a drop down menu.

However when I use AutoIt Window Info on these controls I do not get a Name or ID when using IE. I tried using Chrome and I do get a control ID number, but it is the same for all the controls in this area.

This is what AutoIt Window Info returns for all the controls on the part of the page I am working with while running IE:

Class: Internet Explorer_Server

Instance: 3

ClassnameNN: Internet Explorer_Server3

Name:

Advanced Mode: [CLASS:Internet Explorer_Server; INSTANCE:3]

ID:

Text:

Position 0, 91

Size 1090, 757

Control Click Coords 45, 28

Style 0x56000000

ExStyle 0x00000000

Handle 0x000000000029021A

Any suggestions as to how I can work with these controls is greatly appreciated!

TJ.

Link to comment
Share on other sites

Something unique must be present it may be the classname or value

for more help please give the Site Address

Hope so u r not violating any of the forum rules

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

No, I do not think I am breaking any rules. I am trying to create a script that will go to the Google Currency Exchange page and check the exchange rates on a few currencies and record them to a text file, along with the time and date.

The Google Exchange page can be found here: http://www.google.com/finance/converter

I also tried using the Bank of Canada exchange site with similar issues. It can be found here: http://www.bankofcanada.ca/rates/exchange/daily-converter/

Any assistance getting the Name or ID of the controls on these pages would be greatly appreciated!

Thanks for any help,

TJ.

Link to comment
Share on other sites

Thanks for your ideas Mithrandir. I was looking at the IE UDF earlier today. It looked a bit more complicated than using ControlSend, but is obviously more powerful in many respects.

One question, I tried using "View Source" to look at the page and see if I could find anything. Is using dubugbar to inspect the DOM going to help me find the Name and/or ID attributes that I was looking for originally? Would this show the Name or ID when the AutoIt Window Info Tool does not? From what I was reading it looked like I would still need the control Name or ID to make full use of the IE UDF, am I mistaken about that?

Thanks for any help you can provide,

TJ.

Edited by TJ123
Link to comment
Share on other sites

Thanks for your ideas Mithrandir. I was looking at the IE UDF earlier today. It looked a bit more complicated than using ControlSend, but is obviously more powerful in many respects.

One question, I tried using "View Source" to look at the page and see if I could find anything. Is using dubugbar to inspect the DOM going to help me find the Name and/or ID attributes that I was looking for originally? Would this show the Name or ID when the AutoIt Window Info Tool does not? From what I was reading it looked like I would still need the control Name or ID to make full use of the IE UDF, am I mistaken about that?

Thanks for any help you can provide,

TJ.

Oh, I see, you are mistaking the ID of a window with the ID of an object of an HTML document. Look, the autoit window info is useful to automatize windows like in the winzip auto install that is in the beginning of the helpfile.

Now, to automatize Internet Explorer with the IE UDF, (I assume you have basic knowledge of HTML, if not I would recommend http://www.w3schools.com/html/default.asp ) you have to look in the source code either as you did with ´view source´ or with the help of tools like firebug for firefox or debugbar for IE. There you will find elements with tags like <form name= or <form id=

When an element does not have name or id you can get them by index (first form in the code is 0, second is 1 and so on). With that information, you can make your script.

For instance, in the source of http://www.google.com/finance/converter you can see there's a form with this code:

<form action="/finance/converter" method="f"> (......)

Its name is 'f' go get it with _IEFormGetObjByName ;)

and it has a select with this code:

<select name=from value="">

<option value="AED">United Arab Emirates Dirham (AED)</option> (.....)

There you can use _IEFormElementOptionselect after using IEGetObjById

Try it and show some code even if it doesn't work or If you didn't understand something just ask.

Edited by Mithrandir
Link to comment
Share on other sites

Hey Mithrandir,

Thank you very much for the info. I was really busy the past two days, but I am going to try a few things today based on your suggestions.

I was not aware that method="f" meant that it's name was "f". Just knowing that may help me figure things out from here.

Thanks again,

TJ.

Link to comment
Share on other sites

I'm 99% certain that it does not.

Make that 100% certain. Use _IEFormGetCollection with an index parameter if there is no name= or id=.

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Hi,

Thanks for the advice. I was just looking at the page source and the name is "f", the method is "get". I think Mithrandir might have just made a typo or a cut/paste error.

But thanks for the help, it is appreciated!

TJ.

Link to comment
Share on other sites

Hi,

Thanks for the advice. I was just looking at the page source and the name is "f", the method is "get". I think Mithrandir might have just made a typo or a cut/paste error.

But thanks for the help, it is appreciated!

TJ.

Yes, my bad, I wanted to paste

<form action="/finance/converter" method="get" name="f">

Sorry for the mistake :sweating: . It's good to see you figuring things out and using the IE udf. If you need any help ask again. I remember the days when I was starting with the IE udf and DaleHohm helped me a lot :thumbsup: (by the way now that I saw his signature I think that was because of him that I downloaded debugbar

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...