

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I'm having an issue using web_reg_save_param_regexp in Vugen. I need to grab the "href" parameter from the following HTML code:
<a href="/some/url/here/"> <img src="/some/other/url/here.gif" border="0" align="absmiddle"/> Foo</a>
I have found this href parameter to be anywhere from the second to the fourteenth on the page, so using "ORDINAL=" to find the position doesn't work. As a result, I elected to use web_reg_save_param_regexp.
According to the web_reg_save_param_regexp reference in Vugen, a valid Perl regex will work in this function. I've built and tested the following regex, which correctly extracts the URL I'm looking for:
/href=\"(.+)\">.+Foo<\/a>/si
However, when I insert the following code into Vugen, it complains that the specified parameter can't be found:
web_reg_save_param_regexp("ParamName=Correlation1", "RegExp=<a href=\"(.+)\".+Foo</a>",
LAST);
I assume that this is because the source HTML in the page spans multiple lines, but there does not appear to be an equivalent to Perl's "s" flag, which allows the regex to span multiple lines.
Unfortunately, the href is dynamicly generated each time the application runs, so I can't just hardcode it, and I am not the author of the webpage, so glomming all this together into one line in the page source is not an option.
Help? Am I missing flags for this function? Is there a better way to do this with a different web_reg_save_param_* function?
Thanks.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
I think that the regular expression should be additionally customized as it currently does not capture the value you have provided because it is not checking if the string contains white spaces and the new lines.
For other question if web_reg_save_param_* can be used in this case, I will need to review the script you have recorded and the response from the server you receive. Will it be possible to upload it?
Kind regards,
Vesela
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
I think that the regular expression should be additionally customized as it currently does not capture the value you have provided because it is not checking if the string contains white spaces and the new lines.
For other question if web_reg_save_param_* can be used in this case, I will need to review the script you have recorded and the response from the server you receive. Will it be possible to upload it?
Kind regards,
Vesela
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.