On Friday 04 February 2005 11:51 am, "Mal Herring" <[EMAIL PROTECTED]> 
wrote:
> Hi List,
> I would like to write a script that somehow gets a text only output of a
> webpage - can lynx do this ?
> Then grep the output for a desired string of text - then somehow pass
> the result to an if command so that if the string is found - lauch this
> and if not then loop...
>
> Can this be done ?

Use wget to grab the HTML. (wget <URL> -O -, or somesuch)
Use sed to strip out the HTML tags. (sed -e 's/<[^>]*>//g', or similar)

You probably want something like:

while [ ! "`wget $URL -O - | sed -e 's/<[^>]*>//g' | grep $STRING`" ] ; do
    $CMD_IF_STRING_FOUND
done

-- 
Boyd Stephen Smith Jr.
[EMAIL PROTECTED]
ICQ: 514984 YM/AIM: DaTwinkDaddy

--
gentoo-user@gentoo.org mailing list

Reply via email to