I'm pretty new to javascript and I think that eventhough what I would like to do seems easy it is for me at the moment out of reach without help.
I am searching for a function that simply retrieves the html code between two specified strings from a specified URL:
where 'theurl' is the webpage URL, 'string1' is the string of text to be found in the html code of 'theurl', and 'string2' is the first match to be found after 'string1'. Moreover this is supposed to work with greasemonkey.Code:var thestring = function GetStringURL(theurl, string1, string2) {...} ;
Example:
will look for the first match of 'bgcolor=' in 'http://www.google.com/', then will look for first match of ' text' after 'bgcolor' and it will return the string of text inbetweeen, i.e. in this case it will return '#ffffff'.Code:var thestring = function name ('http://www.google.com/', 'bgcolor=', ' text') {...} ;
Anyone has a hint on how to do that?




Bookmarks