Controlling elinks from Pipe, CLI or Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Controlling elinks from Pipe, CLI or Script
# 1  
Old 12-01-2014
Controlling elinks from Pipe, CLI or Script

Hi guys,

I’m looking for an automatic way to save the source code of an website to a file. My questions is, it is possible to control elinks from a script, pipe or cli? I need to open a website, login on this site by a webform, submit the form, open an new url and save the source code of a data-sheet on this site. Can anybody help me?

Thanks for your answer.
# 2  
Old 12-01-2014
Can you share what you've already done? And have you looked at curl or wget?
-DL
# 3  
Old 12-02-2014
Yes, i have tested curl and wget, but i don't get the source-code of the page because there are some problems with javascript. I've got the following source code:

Code:
 <html>
 <head>
 <script language='javascript'>function autoNavigate() {window.location="data.html";}</script>
 </head>
 <body onload='autoNavigate()'></body>
 </html>

This is the same url as i loaded before. The javascript code reload the same page. But if i load the url with curl or wget a second time, i get a 302 Error.

The same problems by using "lynx" and "w3m". Only "links" and "elinks" shows the content of the page correctly. Thats why i'm looking for a possibility to control the text-browser from a script.

Thanks

---------- Post updated 12-02-14 at 02:37 PM ---------- Previous update was 12-01-14 at 04:59 PM ----------

Here the solutions:

controlling browser from pipe:
https:// vimeo.com/19616296

Controlling browser from script with expect:
http:// expect.sourceforge.net/
you can use autoexpect to record all inputs.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Controlling a program from shell script

Hi all, I am trying to write a shell script that starts a program, reads from its stdout and can write to its stdin. I'm having trouble to get it to work, I tried using named pipes, and using exec and file descriptors. Just couldn't get it to work, so I thought I'll post it here to see if... (4 Replies)
Discussion started by: test it
4 Replies

2. Shell Programming and Scripting

Controlling time stamps in a bash script

Hi, I have a bash script that generates CSV (.txt) files at fairly regular time intervals. I'm currently time stamping each batch of measurements at the time I write the rows into a MySQL database. As the result, one set of data might get the time 12:01:32 and the next set of data gets the time... (18 Replies)
Discussion started by: Zooma
18 Replies

3. Shell Programming and Scripting

Expect script works on CLI, but not under Nagios

I'm having a problem scripting Expect to work as a Nagios check. The script runs fine from the cli, but not when run as a Nagios check. I turn on the debug output, and it looks like it's not seeing the whole buffer's worth of info, like it's paged interactively somehow. I'm new to Expect, but this... (1 Reply)
Discussion started by: dhargens
1 Replies

4. UNIX for Dummies Questions & Answers

Bash - CLI - grep - Passing result to grep through pipe

Hello. I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv" lsmod | (e)grep '^nv???????????? I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long ... (1 Reply)
Discussion started by: jcdole
1 Replies

5. Shell Programming and Scripting

Reading CLI input for script

I've always written scripts where the user executes the script and I prompt them for what they want to do. But I'm trying to write a script where root executes the script 'lock' or its hard-link 'unlock' and the script will passwd -l or passwd -u an account depending on the choice. What would... (3 Replies)
Discussion started by: ADay2Long
3 Replies

6. Post Here to Contact Site Administrators and Moderators

Cannot logon using elinks

There are some computers in the firm that have no GUI, so I use elinks (ELinks - Full-Featured Text WWW Browser) to access the internet. However, logging onto the unix.com forums is not possible, because the page hangs at "Thank you for logging onto the forums, " There is also a line "Please click... (6 Replies)
Discussion started by: figaro
6 Replies

7. Programming

Controlling Xine with Perl script

Hello, I want to write a Perl script that is able to control the playback of files in xine. I read about the xine library for perl, Video::xine, but thats not what I want... I just want a little code that sends , for exemple, a signal to xine to pause playback, continue playback etc. It... (0 Replies)
Discussion started by: al0x
0 Replies

8. UNIX for Dummies Questions & Answers

Controlling GUI from Shell Script

Hi Everybody, I'm trying to create a script that will launch firefox from a bash shell in ubuntu and perform certain tasks. Why does it have to be a script? Because this firefox must eventually run in a server with xvfb (no gnome, no kde), so I will not have access to it through the GUI. At... (2 Replies)
Discussion started by: rummage_bin
2 Replies

9. Shell Programming and Scripting

Controlling GUI from Shell Script

Hi Everybody, I previously posted this under Unix for dummies and got no answers, so here goes again: I'm trying to create a script that will launch firefox from a bash shell in ubuntu and perform certain tasks. Why does it have to be a script? Because this firefox must eventually run in a... (0 Replies)
Discussion started by: rummage_bin
0 Replies
Login or Register to Ask a Question