It would be far more helpful if you provided us with an accurate error message in future.
Just having a quick poke around soy, the server I am now, it looks like /usr/local/bin/lynx is not reference to it's exact location, /usr/bin/lynx:
soy% whereis lynx
lynx: /usr/bin/lynx /etc/lynx.cfg /usr/share/man/man1/lynx.1.gz
Therefore, just change every instance of /usr/local/bin/lynx in your script to /usr/bin/lynx and see if that works.
You ever thought of using the LWP bundle of modules instead of scooping the output of lynx directly?
If you need any help with altering your script, just post a message and I'm sure someone, if not me, can help you further.