Best way to capture text in Internet Explorer

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
deloppoled
Newbie
Posts: 8
Joined: Fri Jul 11, 2014 7:24 am

Best way to capture text in Internet Explorer

Post by deloppoled » Fri Jul 11, 2014 7:58 am

Hello.

I am trying to write a macro that will capture an ITEM NUMBER from eBay in Internet Explorer and place it on the Windows Clipboard. From there, I am good-to-go.

I am looking to please get some advice on what is the best way to do this in Internet Explorer? I know about how to sendkeys CTRL+C routine but I want to get more under the hood and use some of the IE commands or TextCapture commands that Macro Scheduler Standard Home User offers, because I am guessing that they may work better, on a consistent basis.

I've been using Firefox and things were working out fine just sending (via hotkey combination) LDblClick, while my mouse was hovering over the item number. Until I found out that the AutoCopy Firefox Add-on, that was doing the clipboard capture portion, contains spyware. So unless I convert over to Internet Explorer, I would be stuck using the SendKeys method if I wanted to continue to use FireFox because "The text capture functions can only work if Windows' OWN TextOut functions are used to render the text." which that forum post goes on to explain that FireFox does not use (TextOut).

I've been wanting to dig into the IE functionality for a long time so this seems like a great opportunity to do so...

If you open this eBay link and notice that under the auction's title there is text that reads "Item:" followed by a twelve digit number, it is that twelve digit number that I am needing to place on the clipboard (or into a variable). I should also mention that the item number is not always at the same Y coordinate so that may make it a bit more difficult? Hopefully you will see the item number, I think that the format of the page is included in the eBay url but if not, you may have to CUSTOMIZE the lists' view in the upper right area of the screen to include ITEM NUMBER.

Wow, that got longer than I had intended, sorry about that!

Any suggestions on how you would capture the twelve digit item number would be greatly appreciated! Hopefully that all made sense and some of you will have already done similar things to this so it will not be that much of a time consumer if you should choose to respond.

Thank you all very much for reading my post and for any tips, suggestions that you may provide!
Del

deloppoled
Newbie
Posts: 8
Joined: Fri Jul 11, 2014 7:24 am

Re: Best way to capture text in Internet Explorer

Post by deloppoled » Fri Jul 11, 2014 9:47 am

Wow, that was really easy to accomplish in Internet Explorer (IE)!

Code: Select all

GetTextInit
GetCursorPos>mouseX,mouseY,cursorType
GetTextAtPoint>mouseX,mouseY,strText,vCharPos
MessageModal>%strText%
I've been using Firefox for so long due to so many security issues that were present in IE in the past but those issues seem to have been closed up, so hopefully it's not so risky these days. Since I haven't been real happy with Mozilla's politics of late anyway, I guess that using IE is something that I have reconsidered now and am much more open to. Scripting IE really is much less of a hassle than it is in Firefox, not only from Macro Scheduler but in general.

Thanks again, take care. Hope to be around here occasionally, so I will surely see you all around!

deloppoled
Newbie
Posts: 8
Joined: Fri Jul 11, 2014 7:24 am

Re: Best way to capture text in Internet Explorer

Post by deloppoled » Fri Jul 11, 2014 6:16 pm

Actually, after a thought came to mind I checked and found there is a way that we can use Firefox to capture text using Macro Scheduler! We simply use a Firefox addon called IE Tab 2 (FF 3.6+) v5.12.12.1.

Please feel free to read all about it here:

http://www.mjtnet.com/forum/viewtopic.p ... 164#p37164

Del

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Best way to capture text in Internet Explorer

Post by Marcus Tettmar » Sat Jul 12, 2014 10:17 am

IE Tab *IS* IE. It simply wraps an IE browser inside a Firefox tab.

So if you're going to automate IE Tab inside Firefox why not just automate IE in the first place!?

And if you are not using IE because of some paranoia about security, then using IE Tab won't be any different.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Re: Best way to capture text in Internet Explorer

Post by CyberCitizen » Sat Jul 12, 2014 10:38 am

Can you retrieve using Web recorder of even httprequest? Not at computer to test.
FIREFIGHTER

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Best way to capture text in Internet Explorer

Post by Marcus Tettmar » Sat Jul 12, 2014 11:04 am

Yes, if using IE, using the IE/WebRecorder functions would be a better way to extract text/html.

HTTPRequest will work where a GET or POST operation will return the content.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts