Simple applescript to check for text string on webpage

Discussion in 'Mac Programming' started by acribb, Nov 28, 2010.

  1. acribb, Nov 28, 2010
    Last edited: Nov 28, 2010

    Expand Collapse
    macrumors regular

    Nov 30, 2007
    I'm looking for an applescript that searches a web page for a specific text string. So far, I have used curl to read in the webpage source, but now i'm not sure how to read that text into a variable to parse for the specific string.

    Thanks for any help.

    **edit** All I need to use is 'contains'
  2. mwpeters8182
    Expand Collapse
    macrumors 6502

    Apr 16, 2003
    Boston, MA
    If you're using curl, you might as well just use grep to search for the string.

    curl | grep [string] That should return all instances of the string in the text.
  3. acribb
    Expand Collapse
    thread starter macrumors regular

    Nov 30, 2007
  4. jen234
    Expand Collapse
    macrumors newbie

    Dec 1, 2010
    You may also want to consider using Python, which these days seems to be the low-level language of choice or web based queries. Tons of libraries available.

Share This Page