wget to login to an online website
Hi,
I am trying to login to an online site using wget. getting 302 error. Please help!! login Page: https://ssl.buy.com/AC/loginAccount....myaccount.aspx download page: https://ssl.buy.com/AC/myaccount.aspx username: mytest@gmail.com password: 20122012 |
wget is to fetch pages to your local machine if you're looking for a text-based web-browser try lynx http://en.wikipedia.org/wiki/Lynx_(w...External_links
|
Hi Babertje, thanks for your responce. Yes, i am trying to download the page using wget. After that i will run a script to check my order status.
Thanks, |
Hi, can any body help me please....
|
Please Post your complete command line.
|
Have you googled ' "wget "error 302" ' without the single quote.
|
Site may know you are trying that and is blocking it. It is also an active page you posted. ..myaccount.aspx Unlikely to be saved across access.
|
Hi,
Here is full command line i am trying. I got the Cookie from firefox Cookies Manager Add on. wget --no-check-certificate --span-hosts --header "Cookie: BuyComAuthAccountCookie=25A1585346202FB785702DD10A9C08079686A8077EE300C13206013EC379AB88F75AA859672A 1705258ECD3877862732C55A135807AA6BDD41CAE880E066BF7CD26020AAEA754D50EFA67989A1155E90B28D49AEA3691CE1 DE0901A8688771FD7C74ADBDE3701B526E87CE867BF8CD979495AF715635C40D0FAD92E9C9BB86C3" "https://ssl.buy.com/AC/myaccount.aspx" C:\temp\buy>wget --no-check-certificate --span-hosts --header "Cookie: BuyComAut hAccountCookie=25A1585346202FB785702DD10A9C08079686A8077EE300C13206013EC379AB88F 75AA859672A1705258ECD3877862732C55A135807AA6BDD41CAE880E066BF7CD26020AAEA754D50E FA67989A1155E90B28D49AEA3691CE1DE0901A8688771FD7C74ADBDE3701B526E87CE867BF8CD979 495AF715635C40D0FAD92E9C9BB86C3" "https://ssl.buy.com/AC/myaccount.aspx" --2012-05-19 17:20:27-- https://ssl.buy.com/AC/myaccount.aspx Resolving ssl.buy.com... 209.67.181.23 Connecting to ssl.buy.com|209.67.181.23|:443... connected. WARNING: cannot verify ssl.buy.com's certificate, issued by `/C=US/O=VeriSign, I nc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c )06/CN=VeriSign Class 3 Extended Validation SSL SGC CA': Unable to locally verify the issuer's authority. HTTP request sent, awaiting response... 302 Found Location: /AC/MyAccount.aspx [following] . . . . . --2012-05-19 17:20:32-- https://ssl.buy.com/AC/MyAccount.aspx Connecting to ssl.buy.com|209.67.181.23|:443... connected. WARNING: cannot verify ssl.buy.com's certificate, issued by `/C=US/O=VeriSign, I nc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c )06/CN=VeriSign Class 3 Extended Validation SSL SGC CA': Unable to locally verify the issuer's authority. HTTP request sent, awaiting response... 302 Found Location: /AC/MyAccount.aspx [following] 20 redirections exceeded. wget --no-check-certificate --max-redirect=9999 --span-hosts --header "Cookie: BuyComAuthAccountCookie=25A1585346202FB785702DD10A9C08079686A8077EE300C13206013EC379AB88F75AA859672A 1705258ECD3877862732C55A135807AA6BDD41CAE880E066BF7CD26020AAEA754D50EFA67989A1155E90B28D49AEA3691CE1 DE0901A8688771FD7C74ADBDE3701B526E87CE867BF8CD979495AF715635C40D0FAD92E9C9BB86C3" "https://ssl.buy.com/AC/myaccount.aspx" I also tried "--max-redirect=9999" still no luck. Even google didn't help me for 302 redirect issue. Same situation with Curl as well. I really appreciate your help. Thanks... |
Code:
wget --no-check-certificate --span-hosts --header "Cookie: BuyComAuthAccountCookie=25A1585346202FB785702DD10A9C08079686A8077EE300C13206013EC379AB88F75AA859672A 1705258ECD3877862732C55A135807AA6BDD41CAE880E066BF7CD26020AAEA754D50EFA67989A1155E90B28D49AEA3691CE1 DE0901A8688771FD7C74ADBDE3701B526E87CE867BF8CD979495AF715635C40D0FAD92E9C9BB86C3" "https://ssl.buy.com/AC/myaccount.aspx" |
Code:
dave@dave:~$ wget --no-check-certificate --span-hosts --header "Cookie: BuyComAuthAccountCookie=25A1585346202FB785702DD10A9C08079686A8077EE300C13206013EC379AB88F75AA859672A 1705258ECD3877862732C55A135807AA6BDD41CAE880E066BF7CD26020AAEA754D50EFA67989A1155E90B28D49AEA3691CE1 DE0901A8688771FD7C74ADBDE3701B526E87CE867BF8CD979495AF715635C40D0FAD92E9C9BB86C3" "https://ssl.buy.com/AC/myaccount.aspx" |
That page asks for your email and password. Why, if I may ask, don't you just go there and view your account information?
|
Hi Dave,
Thanks for your response, i appreciate it. The reason of this script is to track the order status and integrate the result in another application for the company i am working for. the command you ran, downloaded myaccount.aspx file but it is a login prompt page. If we provide right Cookie then it is leading to 302 redirect issue. i updated with right cookie which i got it from firefox cookie manager, below is the output. C:\temp\buy>wget --no-check-certificate --span-hosts --header "Cookie: BuyComAut hAccountCookie=ACC2261342FBD521CB6A78521FE308AE3DBABC71A5CF63125451B6C3ED69C63A5 A58D74F338925308249813E2365B85A30978EF75FF749205EEDDFEB5E77223848B4BCB6B45DEE371 B68123CC2B2FC4528DDD14FC697BAA6925C6563CA27B7023F926242A0ECB357807EB5AEA05F7BF81 B0B87D3125A694F3D4A406B6D25FBA3" "https://ssl.buy.com/AC/myaccount.aspx" --2012-05-19 19:06:29-- https://ssl.buy.com/AC/myaccount.aspx Resolving ssl.buy.com... 209.67.181.23 Connecting to ssl.buy.com|209.67.181.23|:443... connected. WARNING: cannot verify ssl.buy.com's certificate, issued by `/C=US/O=VeriSign, I nc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c )06/CN=VeriSign Class 3 Extended Validation SSL SGC CA': Unable to locally verify the issuer's authority. HTTP request sent, awaiting response... 302 Found Location: /AC/MyAccount.aspx [following] . . . --2012-05-19 19:06:33-- https://ssl.buy.com/AC/MyAccount.aspx Connecting to ssl.buy.com|209.67.181.23|:443... connected. WARNING: cannot verify ssl.buy.com's certificate, issued by `/C=US/O=VeriSign, I nc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c )06/CN=VeriSign Class 3 Extended Validation SSL SGC CA': Unable to locally verify the issuer's authority. HTTP request sent, awaiting response... 302 Found Location: /AC/MyAccount.aspx [following] 20 redirections exceeded. |
Code:
dave@dave:~$ wget --no-check-certificate --span-hosts --header "Cookie: BuyComAut Have you tried contacting the website and seeing if there are hook you can access or if there is a email they can send with the information you require? D |
Have you considered Perl using the WWW::Mechanize module http://search.cpan.org/~mstrout/WWW-...W/Mechanize.pm
|
I have no idea on how to write code in Perl. Appreciate if you could help.
|
All times are GMT -5. The time now is 09:34 AM. |