Filter lines of a variable that start with...

Keith Clarke keith.clarke at clarkeandclarke.co.uk
Sat May 3 10:14:01 EDT 2014


Hi folks,
I’m working on a little utility to analyse Google search results and I’m trying to isolate just the results list (which sit in an unordered list) form the rest of the HTML page source noise.

I wanted to filter lines with the first 3 chars are “<li” but I’m struggling to get the basic 'filter lines with” function to behave. The first line of this script seems to be successfully inserting returns before the opening <li…>  tags. I’ve checked this by putting the result in the message box and also copying & pasting the resulting content into a text editor. However, the second line - which is meant to remove any lines that don’t contain the opening <li…> tag - is currently behaving as if the line breaks haven’t been inserted.

Currently the effect of the second line is that the output ‘SearchResultsList' field shows:
Nothing when the filter is in its ‘with’ form - as shown
All lines in the source when in its ‘without’ form

   replace "<li" with (return & "<li") in tSearchResultsHTML
   filter lines of tSearchResultsHTML with "<li"
   put tSearchResultsHTML into field "SearchResultsList” 

I’ve tried setting the rowDelimiter to return with no effect. Any clues on where this logic is broken?
Best,
Keith..


More information about the Use-livecode mailing list