Welcome to WebmasterWorld Guest from 54.145.104.199

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

wget to login to website

     
3:32 pm on Jan 18, 2010 (gmt 0)

10+ Year Member



I cannot get wget to successfully login to a page. I try to submit the details by POST to a login form but it doesn't pick up the correct page afterwards, just the standard page when not logged in.
I picked up the form name from the source on this page, not sure if it's the correct one or not.

I am trying to retrieve the HTML from the page every 10mins and if something has changed then to send me an email with the updated page.


[root@serve~]# wget --post-data='username=DUMMYUSER&password=DUMMYPASSWORD' --save-cookies=my-cookies.txt --keep-session-cookies [url]https://www.example.com/widget_month.php[/url]
--2010-01-18 14:51:32-- [url]https://www.example.com/widget_month.php[/url]
Resolving [url]www.example.com[/url]... 72.29.XX.XX
Connecting to [url]www.example.com¦72.29.XX.XX¦:443[/url]... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15559 (15K) [text/html]
Saving to: `widget_month.php'

100%[===========================================================================>] 15,559 63.6K/s in 0.2s

2010-01-18 14:51:33 (63.6 KB/s) - `widget_month.php' saved [15559/15559]

[root@server ~]# wget [url]https://www.example.com/widget_watch_list.php[/url]
--2010-01-18 14:52:16-- [url]https://www.example.com/widget_watch_list.php[/url]
Resolving [url]www.example.com[/url]... 72.29.XX.XX
Connecting to [url]www.example.com¦72.29.XX.XX¦:443[/url]... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17008 (17K) [text/html]
Saving to: `widget_watch_list.php'

100%[===========================================================================>] 17,008 72.3K/s in 0.2s

2010-01-18 14:52:17 (72.3 KB/s) - `widget_watch_list.php' saved [17008/17008]

[root@server ~]# nano widget_watch_list.php
[root@server ~]#

[edited by: phranque at 9:11 pm (utc) on Jan. 18, 2010]
[edit reason] exemplified urls & obscured ips & fix sidescroll [/edit]

12:26 am on Jan 19, 2010 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



perhaps the form requires a session cookie to work.
try requesting the login page while saving the cookie and then provide that cookie when you post the form.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month