Hi Lewis, one way you could go about doing this is to add your extraction rule to the PreRequest event in the request plug-in, for example:
C#
public override void PreRequest(object sender, PreRequestEventArgs e)
{
ExtractRegularExpression rule1 = new ExtractRegularExpression();
rule1.RegularExpression = "<title>\\w*</title>";
rule1.IgnoreCase = false;
rule1.Required = true;
rule1.Index = 0;
rule1.ContextParameterName = "extractedValue";
e.Request.ExtractValues += new EventHandler<ExtractionEventArgs>(rule1.Extract);
}
This will add the rule to each request as it runs and update its value in the context.
Dennis
|