Link to home
Start Free TrialLog in
Avatar of Globemaster
Globemaster

asked on

Getting a value from a Web Page from Linux shell ??

Hello,

Before continuing please excuse my ignorance on this topic because i am relative new to Unix.

I am trying to get my ip-address from http://checkip.dyndns.org through some way in Linux shell. Basically what i want to do is retrieve my ip address that is generated in the index.html file if i browse to that specific site.

I have tried doing a wget http://checkip.dyndns.org and i downloaded the index.html file which contains my correct ip-address inside, but i am not able to retrieve (parse) the html file to get only the IP.

Is there any way you can help me to do this.

Thank you in advance.
Avatar of sjm_ee
sjm_ee
Flag of United Kingdom of Great Britain and Northern Ireland image

This will parse the IP from index.html to stdout:

sed -e "s/^.*: //" -e "s/<.*$//" index.html
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial