Skip to main content
Tweeted twitter.com/#!/StackUnix/status/158329454031151104
added 15 characters in body
Source Link
Mat
  • 54.9k
  • 11
  • 164
  • 143

I'm trying to automate a login process that can only be done through a browser. I am using the lynx browser to script the actions required to do this. Lynx does this by dumping a user's keystrokes into a file and then it allows a flag: -cmd_script=scriptfile-cmd_script=scriptfile to load the script.

I invoke lynx:

lynx -accept_all_cookies -cmd_script="myscript.lynx" www.example.com

lynx -accept_all_cookies -cmd_script="myscript.lynx" www.example.com 

From my interactive terminal, the resulting script works perfectly for me.

I have cron run the task and it doesn't work. I checked /var/log/everything.log and I noticed that when the script ran, lynx asks:

Your Terminal type is unknown! Enter a terminal type: [vt100]

Your Terminal type is unknown! Enter a terminal type: [vt100] 

To fix this, I used the flag -term=linux-term=linux which stopped the issue, but the login process still did not seem to get past the first page (by looking at the log file).

I've tried as many suggestions as I could find. I copied the results from env (in the interactive terminal) and pasted them into the script to see if the environment would fix it, but alas it did not.

Another note: My login process involves a redirect (which doesn't redirect in the lynx browser so I just follow the link it gives)

  1. My login process involves a redirect (which doesn't redirect in the lynx browser so I just follow the link it gives)

I'm trying to automate a login process that can only be done through a browser. I am using the lynx browser to script the actions required to do this. Lynx does this by dumping a user's keystrokes into a file and then it allows a flag: -cmd_script=scriptfile to load the script.

I invoke lynx:

lynx -accept_all_cookies -cmd_script="myscript.lynx" www.example.com

From my interactive terminal, the resulting script works perfectly for me.

I have cron run the task and it doesn't work. I checked /var/log/everything.log and I noticed that when the script ran, lynx asks:

Your Terminal type is unknown! Enter a terminal type: [vt100]

To fix this, I used the flag -term=linux which stopped the issue, but the login process still did not seem to get past the first page (by looking at the log file).

I've tried as many suggestions as I could find. I copied the results from env (in the interactive terminal) and pasted them into the script to see if the environment would fix it, but alas it did not.

Another note:

  1. My login process involves a redirect (which doesn't redirect in the lynx browser so I just follow the link it gives)

I'm trying to automate a login process that can only be done through a browser. I am using the lynx browser to script the actions required to do this. Lynx does this by dumping a user's keystrokes into a file and then it allows a flag: -cmd_script=scriptfile to load the script.

I invoke lynx:

lynx -accept_all_cookies -cmd_script="myscript.lynx" www.example.com 

From my interactive terminal, the resulting script works perfectly for me.

I have cron run the task and it doesn't work. I checked /var/log/everything.log and I noticed that when the script ran, lynx asks:

Your Terminal type is unknown! Enter a terminal type: [vt100] 

To fix this, I used the flag -term=linux which stopped the issue, but the login process still did not seem to get past the first page (by looking at the log file).

I've tried as many suggestions as I could find. I copied the results from env (in the interactive terminal) and pasted them into the script to see if the environment would fix it, but alas it did not.

Another note: My login process involves a redirect (which doesn't redirect in the lynx browser so I just follow the link it gives)

Source Link
Dennis
  • 273
  • 2
  • 8

Running cron script with lynx fails to work

I'm trying to automate a login process that can only be done through a browser. I am using the lynx browser to script the actions required to do this. Lynx does this by dumping a user's keystrokes into a file and then it allows a flag: -cmd_script=scriptfile to load the script.

I invoke lynx:

lynx -accept_all_cookies -cmd_script="myscript.lynx" www.example.com

From my interactive terminal, the resulting script works perfectly for me.

I have cron run the task and it doesn't work. I checked /var/log/everything.log and I noticed that when the script ran, lynx asks:

Your Terminal type is unknown! Enter a terminal type: [vt100]

To fix this, I used the flag -term=linux which stopped the issue, but the login process still did not seem to get past the first page (by looking at the log file).

I've tried as many suggestions as I could find. I copied the results from env (in the interactive terminal) and pasted them into the script to see if the environment would fix it, but alas it did not.

Another note:

  1. My login process involves a redirect (which doesn't redirect in the lynx browser so I just follow the link it gives)