O'Reilly logo

LiveCode Mobile Development Beginner's Guide by Colin Holgate

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – setting up the Text card

Start off in the test stack you made, so we can get the function working there before adding it to the WebScraper stack.

  1. Duplicate the button you made when extracting links. Change the function call getLinks to say getText - otherwise the script can remain the same.
  2. Edit the script of the test stack, and add this function:
    function getText pPageSource
       put replaceText(pPageSource,"(?:<(?P<tag>script|style)[\s\S]*?</(?P=tag)>)|(?:<!--[\s\S]*?-->)|(?:<[\s\S]*?>)","") into pPageSource
       replace lf with "" in pPageSource
       replace tab with " " in pPageSource
       return pPageSource
    end getText
  3. Try clicking on the button you just made. You should see your second field fill with just the text parts of the web page.
  4. Copy the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required