IEExtractTagByAttrib - can't pull needed data

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Jerryth31
Newbie
Posts: 19
Joined: Wed Jun 18, 2008 6:03 pm

IEExtractTagByAttrib - can't pull needed data

Post by Jerryth31 » Wed Feb 21, 2018 6:01 pm

I need to capture this license code but can't figure out how to extract that data
RegKey.png
I have tried the following (and lots of others) and "LicKey" doesn't even show in the Watch List

Code: Select all

// Capture License Key
IEExtractTagByAttrib>IE[0],,textarea,,TextValue,1,LicKey
IEExtractTagByAttrib>IE[0],,td,textarea,TextValue,1,LicKey
I am entering the Registration Code so I know my connection with this page is good.

Any suggestions for grabbing the license info?
Thanks!

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: IEExtractTagByAttrib - can't pull needed data

Post by Grovkillen » Wed Feb 21, 2018 6:10 pm

You might want to try ocr instead.
Let>ME=%Script%

Running: 15.0.27
version history

Jerryth31
Newbie
Posts: 19
Joined: Wed Jun 18, 2008 6:03 pm

Re: IEExtractTagByAttrib - can't pull needed data

Post by Jerryth31 » Thu Feb 22, 2018 12:19 am

I haven't used OCR much so I am surprised at the 'quality' of text capture

If I OCRArea with a small border around the license key, the text gets detected correctly.
As My rectangle gets larger, the detection drops off fast.
If I try to do the entire window, I might get 4 characters out of the 22 character code.

Since I can't be positive about the location, that presents a problem.

I am currently working on right clicking in the field and then copying.
That may solve my problem.

Thanks for the suggestion!

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

Re: IEExtractTagByAttrib - can't pull needed data

Post by Marcus Tettmar » Thu Feb 22, 2018 11:37 am

You need to specify an attribute=value pair to identify the textarea, but instead have specified TextValue which is meaningless. TextValue is not an attribute of this textarea, and doesn't identify anything. Try this:

Code: Select all

IEExtractTagByAttrib>IE[0],,textarea,,id=password-result,1,LicKey
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Jerryth31
Newbie
Posts: 19
Joined: Wed Jun 18, 2008 6:03 pm

Re: IEExtractTagByAttrib - can't pull needed data

Post by Jerryth31 » Fri Feb 23, 2018 8:25 pm

Thanks Marcus but that gave me a blank

The table cell that has the license string is pretty large is fairly easy to locate based on window size so I am able to put the cursor in the middle, select all and copy.

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: IEExtractTagByAttrib - can't pull needed data

Post by Grovkillen » Sat Feb 24, 2018 6:55 am

I would download the page using

"HTTPRequest>" command

and then use

"RegEx>"

with this pattern

"(?<=readonly="">).{6}-.{5}-.{6}-.{5}(?=</textarea>)".

Code: Select all

Let>URL=https://www.url-to-your-site-of-intereset.com
HTTPRequest>URL,,GET,,HTML_RESPONSE,,,,
Let>REGEX_PATTERN=(?<=readonly="">).{6}-.{5}-.{6}-.{5}(?=</textarea>)
RegEx>REGEX_PATTERN,HTML_RESPONSE,,FOUND_SERIAL,FOUND_SERIAL_count,,,
If>FOUND_SERIAL_count>0
  //We have found something
  Let>SERIAL_NUMBER=FOUND_SERIAL_1
Else>
  //Nothing found...
  Let>SERIAL_NUMBER=<unknown>
Endif>
Let>ME=%Script%

Running: 15.0.27
version history

Jerryth31
Newbie
Posts: 19
Joined: Wed Jun 18, 2008 6:03 pm

Re: IEExtractTagByAttrib - can't pull needed data

Post by Jerryth31 » Sun Feb 25, 2018 6:27 pm

Great idea Grovkillen!

I have the Copy/Paste method working and have moved on other issues (getting OCR to work against the Windows application this license is for - buts that's another channel...).
If I have problems with Copy/Paste I will switch to your approach.

Thanks!

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