LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   javascript from the command-line (https://www.linuxquestions.org/questions/programming-9/javascript-from-the-command-line-228141/)

gmartin 09-08-2004 08:52 AM

javascript from the command-line
 
I have a linksys router that has parental control (PC) software installed. I also have a linux (Slackware 9.1) server that needs to stay logged into the PC software in order to do what it needs to do.

The login process is an html page with a bunch of accompanying javascript. I need to be able to capture that script and somehow program it so I can submit the login from the command-line. I've done a fair amount of scripting and programming (most on Windows - some linux) but have done little web or javascript.

Can someone help me assess whether I can do this and if so what tools I'll need to make it happen?

Here are a few things I do know:
  • The login page has a half-dozen hidden form fields that are supplied when the page is loaded. I know I'll likely have to 'get' the login page each time a scrape those variables.
  • The login page contains a fair amount of script.
Let me know what you think

Cedrik 09-08-2004 10:54 AM

Use curl tool, it is certainly installed in your GNU/Linux system, it is capable to submit form from scripts or command-line

man curl and look closely to :

-A (in case of the page react with a certain browser) it is the user agent option
-d send POST data
-b send cookie data

...and much more


All times are GMT -5. The time now is 06:56 PM.