Jump to content
Macro Express Forums

Your approach to finding a text box on a web page?


HeyJim

Recommended Posts

Let's use Google as an example.

https://www.google.com/accounts/NewAccount

You want your macro to enter the text box just to the right of "Your current email address:"

Use ALT + d and the cursor jumps to the address bar as a universal start point and then *maybe* you can then TAB the same number of times and hit that box every time but in practice it doesn't work very well consistently.

 

So how would you approach jumping right to that specific text box for entering your current email address? I've spent hours trying to master this problem and still don't have any clue on a 100% effective solution.

 

Thanks for any input.

Link to comment
Share on other sites

I know what you mean. Tabbing forward or backwards through web pages can be unpredictable. Here are some things that might help. I too would like to hear of an infallible method that doesn't require a lot of pre-knowledge of the page.

 

(1) Is the text box always at the same location on the page, for a given computer? You can give the user a special macro to "train" the computer. That is, open the web page, pop up a ME message telling him to click in the text box, and capture the mouse coordinates when he does the click. Store the coordinates in a file, and retrieve them when the real macro (not the training macro) runs. This requires a somewhat sophisticated user who recognizes that changes to screen resolution, changes to the IE heading data and toolbars, etc. will require him to rerun the training macro.

 

(2) If you know approximately where the text box is, you can scan down the page one pixel at a time looking for the color change of the lines outlining the box.

 

(3) You can verify whether you have found a text box -- though not necessarily whether it is the right one -- by having the macro type something, then HOME followed by SHIFT-END to highlight the typed text, copy it to clipboard, and find out whether the clipboard now contains what you typed. If it doesn't, then you were not typing in a text box to begin with. If it does, erase your trial typed-in text and continue on your way.

Link to comment
Share on other sites

Let's use Google as an example.

https://www.google.com/accounts/NewAccount

You want your macro to enter the text box just to the right of "Your current email address:"

Use ALT + d and the cursor jumps to the address bar as a universal start point and then *maybe* you can then TAB the same number of times and hit that box every time but in practice it doesn't work very well consistently.

 

So how would you approach jumping right to that specific text box for entering your current email address? I've spent hours trying to master this problem and still don't have any clue on a 100% effective solution.

 

Thanks for any input.

 

 

 

Hola,

 

Using your example website

 

You could use the find command (Ctrl + F) in IE. If you were looking for the "Your current email address:" text box, searching for it though Find will Highlight the text next to the box. Then have the macro kill the find window and just hit tab to put the cursor in the text box.

 

<REM2:-=+=--=+=- Open Website -=+=--=+=-><HTTP2:1:F:https://www.google.com/accounts/NewAccount><WAITWEB2:000010:000000:https://www.google.com/accounts/NewAccount><REM2:><REM2:><REM2:><REM2:-=+=--=+=- Open Find Window -=+=--=+=-><TEXTTYPE:<ALT><ALT>EF><WAITWIN2:000010:000000:Find><REM2:><REM2:><REM2:><REM2:-=+=--=+=- Look For First Text Box -=+=--=+=-><TEXTTYPE:email address:><TEXTTYPE:<ALT>F><WCLS:"CURRENT"><REM2:><REM2:><REM2:><REM2:-=+=--=+=- Enter Text Box -=+=--=+=-><TEXTTYPE:<TAB>Username@gmail.com><REM2:><REM2:><REM2:><REM2:-=+=--=+=- Open Find Window -=+=--=+=-><TEXTTYPE:<ALT><ALT>EF><WAITWIN2:000010:000000:Find><REM2:><REM2:><REM2:><REM2:-=+=--=+=- Look For First Text Box -=+=--=+=-><TEXTTYPE:Choose a password:  ><TEXTTYPE:<ALT>F><WCLS:"CURRENT"><REM2:><REM2:><REM2:><REM2:-=+=--=+=- Enter Text Box -=+=--=+=-><TEXTTYPE:<TAB>MacroExpress!><REM2:><REM2:><REM2:><REM2:-=+=--=+=- Open Find Window -=+=--=+=-><TEXTTYPE:<ALT><ALT>EF><WAITWIN2:000010:000000:Find><REM2:><REM2:><REM2:><REM2:-=+=--=+=- Look For First Text Box -=+=--=+=-><TEXTTYPE:Re-enter password: ><TEXTTYPE:<ALT>F><WCLS:"CURRENT"><REM2:><REM2:-=+=--=+=- Enter Text Box -=+=--=+=-><TEXTTYPE:<TAB>MacroExpress!><REM2:><REM2:><REM2:><REM2:-=+=--=+=- Open Find Window -=+=--=+=-><TEXTTYPE:<ALT><ALT>EF><WAITWIN2:000010:000000:Find><REM2:><REM2:><REM2:><REM2:-=+=--=+=- Look For First Text Box -=+=--=+=-><TEXTTYPE:Word Verification: ><TEXTTYPE:<ALT>F><WCLS:"CURRENT"><REM2:><REM2:-=+=--=+=- Enter Text Box -=+=--=+=-><TEXTTYPE:<TAB>Like I have Any Idea What It Says>

Link to comment
Share on other sites

Ok. Bad example. My apology offered. This ebay page seems to represent more accurately the problem I have had in the past.

 

https://signin.ebay.com/ws/eBayISAPI.dll?Si...www.ebay.com%2F

 

I'm trying it with "User ID" and "Password" and your very good suggestion doesn't seem to work in Firefox or IE 8 on this page. Your suggestion does work in some situations but apparently not in all?

Link to comment
Share on other sites

I tried monpasdg's solution with "sign in to your account" on the ebay page, and it worked nicely. Whether it would work CONSISTENTLY on that page, I don't know.

I'm not sure how experienced you are with this but undoubtedly you have more experience than I do so I pose this question to you. His idea worked for my Google example but not for the Ebay page while you on the other hand did actually have success with the Ebay page.

 

Do you, or anyone for that matter, have any wild guesses on why it won't work for me with the Ebay page. I tried with Firefox 1 and 3 and IE6 & 8 over two computers and experimented with it on Ebay for quite a while with absolutely no successes. It worked for you at least once but never for me so I'm really baffled now. I thought it was just an absolute limitation of ME but then it worked for you on the Ebay page.

Link to comment
Share on other sites

I just went through this problem with another project, where tabbing among fields on the same web site responded differently on IE6 vs. Firefox 3. In fact with IE6 it was not consistent on the same web site even from one time to the next.

 

I do not understand Internet and web sites very well, so this may be total bunk, but:

I think portions of a web page can arrive at your PC via different routes over the Internet, and the portions don't necessarily arrive "top to bottom" in the same order they were transmitted. Your browser puts them back together as they arrive at the PC; that's why you see chunks of the page appear in unpredictable order. It's my guess that the random arrival, and the internal logic by which different browsers put all the pieces together, is what make finding the field so difficult with a program.

 

That's my story and I'm sticking to it.

 

See my initial response to your question, at the top of this thread. I have used all three of those techniques with success.

Link to comment
Share on other sites

I just went through this problem with another project, where tabbing among fields on the same web site responded differently on IE6 vs. Firefox 3. In fact with IE6 it was not consistent on the same web site even from one time to the next.

 

I do not understand Internet and web sites very well, so this may be total bunk, but:

I think portions of a web page can arrive at your PC via different routes over the Internet, and the portions don't necessarily arrive "top to bottom" in the same order they were transmitted. Your browser puts them back together as they arrive at the PC; that's why you see chunks of the page appear in unpredictable order. It's my guess that the random arrival, and the internal logic by which different browsers put all the pieces together, is what make finding the field so difficult with a program.

 

That's my story and I'm sticking to it.

 

See my initial response to your question, at the top of this thread. I have used all three of those techniques with success.

I think your theory is less bunk than my theory. My theory is that the internet in general is 80% technology, and then in math that only a witch doctor could understand, 25% Voodoo and I base this on all of the inconsistencies we've all experienced over the years.

 

For Macro Express I'll stick with your procedures. Before long though I'll probably have to bite the bullet and learn a new system by purchasing iMacros. I played around with their free Firefox plugin a few months ago and it doesn't seem to have this problem. But I really like Macro Express...

Link to comment
Share on other sites

I think your theory is less bunk than my theory. My theory is that the internet in general is 80% technology, and then in math that only a witch doctor could understand, 25% Voodoo and I base this on all of the inconsistencies we've all experienced over the years.

 

For Macro Express I'll stick with your procedures. Before long though I'll probably have to bite the bullet and learn a new system by purchasing iMacros. I played around with their free Firefox plugin a few months ago and it doesn't seem to have this problem. But I really like Macro Express...

You can use macro express to call Imacro macros. I am happy you mentioned that plugin. I am going to be meshing it with some funky macros that i have at work. It should work great :D

Link to comment
Share on other sites

You can use macro express to call Imacro macros. I am happy you mentioned that plugin. I am going to be meshing it with some funky macros that i have at work. It should work great :D

I never gave that a thought but it sounds like my best solution, too. I'll probably buy the cheaper edition of iMacro and use that for much of my web work. Other than playing around with the free Firefox plugin for a few minutes I have no experience with iMacros. Is there any trick to calling an iMacro into the Macro Express work flow? I haven't made any new macros in probably the last two years.

Link to comment
Share on other sites

One way to deal with this problem is to use the Firefox add-on, "Mouseless browsing"

It numbers every link, text box, and check box on web pages. So you just need to send key strokes of the text box needed.

 

Here is a screen shot of the Ebay sign in page with Mouseless installed:

ebayc.jpg

 

Mouseless Browsing

 

Hope that helps

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...