supergg02 Posted February 28, 2006 Share Posted February 28, 2006 I'm trying to catch arguments from a javascript function Exemple: My_js_Fun(0,24,null,true,'abcd',var) as it appear in html source code Mu goal is to get all these arguments. I have no succed with this pattern $array=StringRegExp ( $html, "(My_js_Fun\(.*\)" , 2) please help me if you have an other solution (maybe with a IE.au3 ) or with an other better solution Link to comment Share on other sites More sharing options...
seandisanti Posted March 8, 2006 Share Posted March 8, 2006 I'm trying to catch arguments from a javascript function Exemple: My_js_Fun(0,24,null,true,'abcd',var) as it appear in html source code Mu goal is to get all these arguments. I have no succed with this pattern $array=StringRegExp ( $html, "(My_js_Fun\(.*\)" , 2) please help me if you have an other solution (maybe with a IE.au3 ) or with an other better solutioni'm not good with regexp either, but there's always more than one way to skin a cat. i would suggest using IE.au3 to read the html code to a string; then parsing out what you want like: $TheFuncCall = StringInStr($htmlcode, "My_js_Fun(") $parameters = StringSplit(StringMid($htmlcode, $TheFuncCall + 10, StringLen($htmlcode) - StringInStr(StringRight($htmlcode, StringLen($htmlcode) - $TheFuncCall + 10), ")"), ",") the forum formatting will probably turn that into several lines, but it's actually just 2. the first identifies the numeric location for the beginning of the function call; that is then used in a couple of places to identify the parameter list, which is seperated by stringsplit and put into array $parameters. $htmlcode is just a representation of whatever variable you use to store the entire contents of the documents's html. the string created using IE.au3 suggestion... Link to comment Share on other sites More sharing options...
Valuater Posted March 8, 2006 Share Posted March 8, 2006 The IE.au3 Builder is in my signature You can copy from the "Examples" view... Paste into the "Builder Form".... and press "Test Run Form" you can see the example executed IE Builder is in my signature below 8) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now