homepage Welcome to WebmasterWorld Guest from 54.196.201.253
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
wget to login to website
jackvull




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

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]

 

phranque




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

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved