Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   How to login and export to CSV using wget?, posted by Alan Grant on Sun Apr 24 02:09:47 2016 
    icon2.gif   Re: How to login and export to CSV using wget?, posted by Alan Grant on Sun Apr 24 06:49:33 2016 
Message ID: 68303     Entry time: Sun Apr 24 06:49:33 2016     In reply to: 68302
Icon: Reply  Author: Alan Grant  Author Email: agrant@winnipeg.ca 
Category: Question  OS: Windows  ELOG Version: 3.1.1 
Subject: Re: How to login and export to CSV using wget? 

UPDATE:

After days of head banging and trying different syntax combinations, I finally stumbled on my own answer. It involved some syntax adjustments, and then splitting the task into these two consecutive operations:

      1. wget --no-check-certificate --cookies=on --save-cookies cookies.txt --keep-session-cookies -O e:\export1.csv "http://localhost:8080/demo/?uname=agrant&upassword=skipper"

      2. wget --no-check-certificate --cookies=on --load-cookies cookies.txt --keep-session-cookies -O e:\export2.csv http://localhost:8080/demo/?mode=CSV1

All is working fine now.

Alan Grant wrote:

Is it possible to use wget to log into elog and export all of a logbook's data into a CSV file?

I can accomplish this perfectly when authentication IS NOT required by using:  wget --no-check-certificate -O e:\export.csv http://localhost:8080/demo/?mode=CSV1

However, I cannot accomplish it when authentication IS required by using:  wget --no-check-certificate -O e:\export.csv "http://localhost:8080/demo/?mode=CSV1&uname=agrant&upassword=skipper"

The latter appears to show that I've logged in, but the export file only contains a bunch of HTML tags, not the actual data as in the former.

How should I construct the wget command?

 

 

ELOG V3.1.5-3fb85fa6