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

    macrumors regular

    Joined:
    Nov 30, 2007
    #1
    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. macrumors 6502

    Joined:
    Apr 16, 2003
    Location:
    Boston, MA
    #2
    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. thread starter macrumors regular

    Joined:
    Nov 30, 2007
    #3
     
  4. macrumors newbie

    Joined:
    Dec 1, 2010
    #4
    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