LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Download page from a google account (https://www.linuxquestions.org/questions/linux-software-2/download-page-from-a-google-account-4175584348/)

Utarg 07-11-2016 01:56 PM

Download page from a google account
 
Hi,

I've been trying to download a text or html file from a google account. I've tried it with Lynx but it always redirects me to the login page. Same thing with wget, I'm running the below to download my gmail inbox:

wget --user=MY.USEr@gmail.com --password=PASSWD --no-check-certificate "https://mail.google.com/mail/u/0/#inbox

but it's the same story, I get stuck at the login page. I'm clearly doing something wrong, any help on this?

FredGSanford 07-11-2016 04:53 PM

I don't know anything about the way you're doing it. I've never tried it that way. But, can the files be put on a shared Google Drive? That may be how google want's to do it now days! Just a thought!

Utarg 07-12-2016 02:17 AM

Hi Fred,

Yes they can be placed in a Google Drive, but I need them in my computer to manipulate them with my scripts. I know wget and even lynx can be used to download html pages, even the ones which require authentication, but I can't seem to find the way to download the ones from Google.

AwesomeMachine 07-12-2016 06:31 AM

#inbox is not a file. With wget you must specify a file. #inbox is PHP or something like that. You can sometimes look at the page code and see what it points to. Something like index.html. You just need to find the file with the email links in it. Wget will follow all the links in the file specified and download the corresponding files. I hope this helps.

ondoho 07-12-2016 12:12 PM

Quote:

Originally Posted by Utarg (Post 5574238)
I've been trying to download a text or html file from a google account. I've tried it with Lynx but it always redirects me to the login page. Same thing with wget, I'm running the below to download my gmail inbox:

wget --user=MY.USEr@gmail.com --password=PASSWD --no-check-certificate "https://mail.google.com/mail/u/0/#inbox

but it's the same story, I get stuck at the login page. I'm clearly doing something wrong, any help on this?

Quote:

Originally Posted by man wget
--password=password
Specify the username user and password password for both FTP and HTTP file retrieval. These parameters can be
overridden using the --ftp-user and --ftp-password options for FTP connections and the --http-user and --http-password
options for HTTP connections.

"password" here is not what you think it is. you cannot log into a google account this way.
why don't you use a mail program like thunderbird for that? google supports that.

also i don't think gmail will let you use a text only browser.
but i could be wrong there.

Utarg 07-12-2016 01:08 PM

Hi guys,

Thanks for the replies, I found the way to do it. First by downloading the cookies once you're logged in and then you can use the --load-cookies=/cookies.txt option with wget when requesting any file.

AwesomeMachine 07-12-2016 09:41 PM

What is the filename for #inbox?

Utarg 07-13-2016 03:14 AM

https://mail.google.com/mail/feed/atom

ondoho 07-14-2016 02:14 AM

well done Utarg, and thanks for sharing the solution.
others will benefit.
please mark this thread [SOLVED].


All times are GMT -5. The time now is 01:34 PM.