like condition in Javascript

Hi,

I would like to extract data that included a certain word in a variable. Although when I do this

unfortunately the productname variable includes all html until it finds the word Roundup (which could be quite a way down the page)

If there a way I could in my script test if productname has the word roundup in it? i.e

String pagestart = session.getVariable( "productname" );
if(pagestart.equals("Roundup") )
DO THIS

then I would be able to capture the whole product name and only go forward with the scrape if it the test = true.

or is there another way to only capture the information I need in an extractor pattern?

thanks in advance
Kerri

like condition in Javascript

Thanks Scott - easy when you know how!

like condition in Javascript

Also, it's worth emphasizing that most all tokens should utilize some regular expression. Only when wanting to match large chunks of client-side code would you generally not use a regular expression.

like condition in Javascript

Kerri,

You should definitely handle this with your extractor pattern. What regular expression are you using for your "productname" token? If not any, then I recommend you at lease use the "Non-HTML tags" selection as this will keep your token from matching beyond the next HTML tag.

-Scott