Capture Username & Password Fields

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

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

Capture Username & Password Fields

Post by CyberCitizen » Tue Apr 22, 2014 7:49 am

Can I ask what the best way is to capture the username & password fields into an array.

Note the amount of items can change, so instead of using length and midstr etc I was hoping to extract the details into an array and then export that info at a later time.

This is what I have so far, except I end up with extra items into the array. I need another set of eyes for assistance.

Let>HTTP_TIMEOUT=30
HTTPRequest>http://newzfinders.com/NewsAccFree/List ... GET,,vHTML,,,,
StringReplace>%vHTML%,<User>,##USER##,vHTML
StringReplace>%vHTML%,</User>,##USER##,vHTML
StringReplace>%vHTML%,<Pass>,##PASS##,vHTML
StringReplace>%vHTML%,</Pass>,##PASS##,vHTML
Separate>%vHTML%,##USER##,aUserArray
Separate>%vHTML%,##PASS##,aPassArray

  View Snippet Page
FIREFIGHTER

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

Post by Marcus Tettmar » Tue Apr 22, 2014 8:06 am

Use RegEx. RegEx returns an array of matches:

RegEx>(?).*?(?=),HTML,0,user_matches,num_users,0

That will give you an array of usernames (anything that appears between a ... tag.

See:
http://www.mjtnet.com/blog/2012/10/29/m ... sed-regex/
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: 724
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Tue Apr 22, 2014 10:29 am

Thanks Marcus,

I always forget about RegEx, such a simple statement as well.

Just had to change the source its looking at but it works. Thanks again.
FIREFIGHTER

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