How to fetch data from a webpage and a proprietary IOS
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to fetch data from a webpage and a proprietary IOS
Hello! I need to know how can I accomplish these tasks and which tool will be best for it.
a) Get specific values from a webpage and store them in variable. Storing is not issue but how to catch a specific value from the output on a webpage
b) How to get logged in another device IOS .. you can assume it a Cisco router and then execute a command and catch some specific values from the output.
this read an awful lot like, which you should not be asking us to do for you, but for webpages try curl or wget to obtain the data and go from there. for IOS, expect is possibly going to be a useful tool.
Indeed, it looks like cut and paste from an assignment sheet...
Another interesting tool is Twill.
No it's not an home work but a try to automate a personal task that I've to do everyday at office.
a) Giving IP of Cable Mode to a webpage[cabe modem status] and retrieving some values and note them manually in spreadsheet file. I want the script to automatically pass the IP to page one by one and then pick the required values and put in variable for later making report.
b) Login to CMTS's IOS and passing a single commandto show online Cable modems on each slot and pick the required values.... it looks difficult .....
a) Giving IP of Cable Mode to a webpage[cabe modem status] and retrieving some values and note them manually in spreadsheet file. I want the script to automatically pass the IP to page one by one and then pick the required values and put in variable for later making report.
This varies a lot and depends on how the website is designed. Is it a web form? does the website have an API? Parsing the result poses the same challenges.
Can you provide the html code for the webpage, and the html code for the result, and which values you want from them?
Well, I've got somehow th idea to fetching values from a webpage....
The requesting page's concerning code is
Quote:
Please type in the CM MAC address or CM IP Address to check the status and press ENTER
<font size=+2 color=white>
<form>
<input name=t>
</form>
and the ouput code is simple the retrieved data in <pre> tag...
Quote:
<hr><PRE>****************** Cable Modem Status through CM IP Address *********************
IP Address 10.192.44.151
Package "128KbRes1.1_d.cfg"
Status Registered
CPE 00:10:B5:53:397
00:19:47:5A:36:60
Public IP
Vendor Scientific-Atlanta, Inc.
Model WebSTAR DPC2100
Firmware "(unknown)"
System Uptime 2:57:29.00
Downstream Frequency 788750000 MHz
Upstream Centre Frequency 35 MHz
Receive Power Level -2 dBmV
Transmit Power Level 42 dBmV
Signal to Noise Ratio 29 dB
</PRE><hr>
the values in bold are what i want to pick up automatically.
well, i think it is not a big deal after learning some scripting i can do it .. but the problem is the other task...
How to login to a machine's OS and pass command n pick values from the output hrougha script....? cna it be doin with Python/PHP etc or BASH scripting can do it... i don't have any idea...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.