add session variable tokens to extractor patterns
e.g. say I've got an extractor pattern like
<tr class="bob">
~@TABLE_TEXT@~ </tr>
~@TABLE_TEXT@~ </tr>
but the table class I want to search for is either "bob" or "harry" dependant on the results of the previous page (yet both appear on the same page).
It would be handy to be able to have a pattern like
<tr class="~#TABLE_TYPE#~">
~@TABLE_TEXT@~ </tr>
~@TABLE_TEXT@~ </tr>
where TABLE_TYPE is a session variable and the pattern text is evaluated before the pattern is applied.
That would be groovy...
You can do something like
You can do something like that. The extractor would be:
<tr class="~@TABLE_TYPE@~">~@TABLE_TEXT@~</tr>
And you would set the RegEx in the TABLE_TYPE. Most of the time I don't set the RegEx with a variable, but it can be done.
That's true but it won't help
That's true but it won't help if both possibilities appear on one page and I only want to extract one set.
if I use a pattern like [bob|harry] it will match both regardless...
There's ways around it like filtering the results with a script or using two extractor patterns and alternating but this is more error prone and makes the scripts more complicated because you have keep switching between two dataSets...
I would think this would be pretty easy to implement. I presume that underlying it all is a Pattern.compile(extractorPatternText); statement with token simply replaced by regex groups. You could just resove the session variable tokens to static strings before the regex pattern in compiled and bob's your uncle...