|
tommytx
|
 |
« on: September 21, 2010, 11:02:59 AM » |
|
Example one. <button tabindex="1" type="submit" name="U2F.sdGVkX18xN.TM:0NDE1MyrfgTOsvyQEhy5WAmmTpTJHwFrCl5-X:WjDLXzfZdMI9" value="Continue">Continue</button>
Example Two. <button type="submit" name="U2FsdGVkX180MjgyN:DI4MtrQcIzzMPmJ4VYQMHXXBpo8:CK5wQO_AxyypP_.6bh0M7" value="Continue" tabindex="1">Continue</button>
I need to pull out nothing but the actual value for name... as below.. it changes value and length...each time. U2F.sdGVkX18xN.TM:0NDE1MyrfgTOsvyQEhy5WAmmTpTJHwFrCl5-X:WjDLXzfZdMI9
type="submit" appears only once in the entire file... value="Continue" appears only once in the entire file...
No other line in the html file has the word submit so it can be a valuable marker... Value="Continue" is not used anywhere else either..
Thanks for any help....
I will over and over pull out the name to use in DOM with getbyname.. but the DOM will not pick up the name as it changes each time... so I have to use something to get the name every time so I can plug it in to force a click of that Continue button using the long varying name as Identification.... as NO ID is used..
|
|
|
|
|
Logged
|
|
|
|
|
tommytx
|
 |
« Reply #1 on: September 21, 2010, 11:07:43 AM » |
|
One more tidbit... this does not run in php, its running in Autoit... however I believe autoit will run most any of the normal regex code... but there may be a few things php can handle that autoit will not understand....
|
|
|
|
|
Logged
|
|
|
|
|
perkiset
|
 |
« Reply #2 on: September 21, 2010, 01:09:57 PM » |
|
Without testing, I believe this is how it could look (one way of doing it) if I implemented it in PHP or JavaScript:
Assuming that the "submit" only appears once in the document, you've got a great anchor.
/submit" name="([^"]{1,256})/i
Essentially, find submit" name=" then collect everything that is not a quote (meaning up till) between 1..256 characters. I'm not sure right ATM but I think you could just go ([^"]*) as well, meaning any number of characters up to a quote.
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
tommytx
|
 |
« Reply #3 on: September 21, 2010, 01:19:39 PM » |
|
Thanks Perk... I will try this when I get back to my office later tonight.
|
|
|
|
|
Logged
|
|
|
|
|
DangerMouse
|
 |
« Reply #4 on: September 21, 2010, 01:49:17 PM » |
|
Maybe a simpler way would be to load the page in to some form of DOM parser and then pull out the value of the attribute? ...I hate regex so I'm biased though!
DM
|
|
|
|
|
Logged
|
|
|
|
|
lamontagne
|
 |
« Reply #5 on: September 21, 2010, 03:22:25 PM » |
|
Maybe a simpler way would be to load the page in to some form of DOM parser and then pull out the value of the attribute? ...I hate regex so I'm biased though!
DM
Ruby + Nokogiri/HPricot = Win ... for small stuff anyway
|
|
|
|
|
Logged
|
"Long time no see. I only pray the caliber of your questions has improved." - Kevin Smith
|
|
|
|
Bompa
|
 |
« Reply #6 on: September 21, 2010, 10:26:08 PM » |
|
type="submit" name="(.*?)"
|
|
|
|
« Last Edit: September 21, 2010, 10:31:00 PM by Bompa »
|
Logged
|
Whenever I point my finger, I have three pointing back at me.
|
|
|
|
perkiset
|
 |
« Reply #7 on: September 21, 2010, 10:32:46 PM » |
|
Bomps what does the question mark do in that regex?
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
Bompa
|
 |
« Reply #8 on: September 21, 2010, 11:00:49 PM » |
|
Bomps what does the question mark do in that regex?
It makes it non-greedy so that it stops at the first " Without the ?, the .* would match all the way to the last " on the page.
|
|
|
|
« Last Edit: September 21, 2010, 11:04:56 PM by Bompa »
|
Logged
|
Whenever I point my finger, I have three pointing back at me.
|
|
|
|
perkiset
|
 |
« Reply #9 on: September 21, 2010, 11:17:17 PM » |
|
Thanks mate, cool.
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
vsloathe
|
 |
« Reply #10 on: September 30, 2010, 12:33:07 PM » |
|
Simpler solution is to use .+ instead of .*
+ isn't greedy
|
|
|
|
|
Logged
|
hai
|
|
|
|
nutballs
|
 |
« Reply #11 on: September 30, 2010, 05:10:47 PM » |
|
err yes it is
+ is to match the previous item 1 time or more and is greedy.
.+ would match any string .* would match even a blank string
|
|
|
|
|
Logged
|
I could eat a bowl of Alphabet Soup and shit a better argument than that.
|
|
|
|
vsloathe
|
 |
« Reply #12 on: October 14, 2010, 10:55:40 AM » |
|
o rite
forgot
nearly everything is greedy on its own except ??, and noone uses that.
|
|
|
|
|
Logged
|
hai
|
|
|
|
svakanda
|
 |
« Reply #13 on: December 01, 2010, 06:06:08 AM » |
|
your MOM is greedy, vs_loathe!!!!! Do you want to buy a picture?!@?!?  ??/ 
|
|
|
|
|
Logged
|
a ship is safe in the harbor, but that's not what it's for.
|
|
|
|