I am trying to run lynx in my perl cgi script so it extracts some text from wen page. I am doing it as in the following manner in my script,
lynx -source -preparsed "$url" > data.txt
But I get the following error in my server's error_log:
Looking up www.xyz.com
Making HTTP connection to www.xyz.com Alert!:
Unable to connect to remote host.
lynx: Can't access startfile xyz.com
I get the same error when I tried to execute lynx from the command line for root user. But the perl script and the lynx command work normally when I run it in normal user.Our newtwork consists of proxy settings which I had done in /etc/lynx-site.cfg
as PROTOCOL_proxy="http://proxy.abcdxyz.ac.in:8080"
.But it hasnot given any result.
Method 1: Start a new shell (xterm), then check the environment variables: % env | grep -i proxy http_proxy=http://172.17.0.130:8080/ ftp_proxy=ftp://172.17.0.130:8080/ all_proxy=socks://172.17.0.130:8080/ ... Note that existing shells will not have updated environment variables.
Set a Lynx proxy as follows:
/etc/lynx-site.cfg
Add:
http_proxy:http://proxy.abc.xyz:8080
The proxy is set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With