RE: Open IE and fill out a Web-Form
:>> Talking about filling forms, Have you tried to fill out form :>> with data field "input field"=file? I have tried to used :>> package Win32::SAM which use IE directly and failed to do it. :> :>Yes, Mech allows you to upload files. There's an example script :>that uploads :>photos to www.photobucket.com included in the Mech distribution. :> Thanks for the information. It's much helpful;) Cheers, WWang +-Wenjie Wang ---+ | WANG Infonology Systems Pty Ltd - Your Partner for the Future | | Phone : (02) 9871 2018 |EMail : [EMAIL PROTECTED] | | Mobile: 0412 688 380|http://www.wiseagent.com.au/ | +-+--+ ___ Perl-Win32-Web mailing list Perl-Win32-Web@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: How to down load a page from web site which is expecting a browser supporting Frame
Hi Chris, Just realized that there is a frame tag being downloaded after examine the downloaded html file. Now, I now what to do next. I'm going to add a noframe redirect to my LWP download sub, in addition to the existing normal "redirect". Regards, Wang >-Original Message- >From: Gerber, Christopher J [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, 12 February 2003 10:29 AM >To: '(William) Wenjie Wang'; [EMAIL PROTECTED] >Subject: RE: How to down load a page from web site which is expecting a >browser supporting Frame > > >> -----Original Message- >> From: (William) Wenjie Wang [mailto:[EMAIL PROTECTED]] >> Sent: Tuesday, February 11, 2003 6:05 PM >> >> Greetings, >> >> I've been successfully downloading web pages using >> LWP::UserAgent without >> any problem till I meet "http://www.ingrammicro.com.au";. All >> I could get is >> a complaint from the web server that my browser doesn't >> support frame :( It >> says: >> >>This page uses frames, but your browser doesn't support >> them. >> >> I've present my user agent is "Mozilla/4.0 (compatible; MSIE >> 6.0; Win32)", >> but I'm still couldn't get away from it. Following is my code snip: >> ---8<- >> my $myUserAgent = LWP::UserAgent->new(); >> $myUserAgent->agent("Mozilla/4.0 (compatible; MSIE 6.0; >> Win32)"); >> $myUserAgent->cookie_jar(HTTP::Cookies->new(autosave => 1)); >> local $PageURL = 'http://www.ingrammicro.com.au'; >> my $myRequest = new HTTP::Request 'GET', $PageURL); >> $myResponse = $myUserAgent->request($myRequest); >> ---8<- >> >> I would like to know how to deal with this kind of situation? Any >> suggestion is much appreciated. >> >> >> TIA >> >> WWang >> > >WWang, > >The basic problem is that when a page is using frames, the host >document for >the frames simply lists the subdocuments and how to lay them out. You'll >probably need to parse the HTML and then load each of the subdocuments. >I've never used LWP or a Perl HTML parser, so I'll have to skip >the example. >Basically you want to look for src="some/relative/url/path" ... > >and pull out the src tag. I wish I had some better details for you, but I >don't... :) > >Chris > > >LEGAL NOTICE >Unless expressly stated otherwise, this message is confidential >and may be privileged. It is intended for the addressee(s) only. >Access to this E-mail by anyone else is unauthorized. If you are >not an addressee, any disclosure or copying of the contents of >this E-mail or any action taken (or not taken) in reliance on it >is unauthorized and may be unlawful. If you are not an addressee, >please inform the sender immediately. > ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
How to down load a page from web site which is expecting a browser supporting Frame
Greetings, I've been successfully downloading web pages using LWP::UserAgent without any problem till I meet "http://www.ingrammicro.com.au";. All I could get is a complaint from the web server that my browser doesn't support frame :( It says: This page uses frames, but your browser doesn't support them. I've present my user agent is "Mozilla/4.0 (compatible; MSIE 6.0; Win32)", but I'm still couldn't get away from it. Following is my code snip: ---8<- my $myUserAgent = LWP::UserAgent->new(); $myUserAgent->agent("Mozilla/4.0 (compatible; MSIE 6.0; Win32)"); $myUserAgent->cookie_jar(HTTP::Cookies->new(autosave => 1)); local $PageURL = 'http://www.ingrammicro.com.au'; my $myRequest = new HTTP::Request 'GET', $PageURL); $myResponse = $myUserAgent->request($myRequest); ---8<- I would like to know how to deal with this kind of situation? Any suggestion is much appreciated. TIA WWang ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Helps needed on https thorough a firewall/proxy server
Greetings, I'm runing ASPerl build 633(v5.6.1 built for MSWin32-x86-multi-thread) on win2k box. I'm behind a fire wall and I have to had a proper proxy setting before I can access the internet. I have got no problem with http GET/POST. After some struggles, I finally added SSL support to my LWP and have both GET and POST works. Well, sort of :( I can only do GET/POST to some web sites. For some sites, I am still having problem "500 (Internal Server Error) Can't connect to www.nodeworks.com:443 (Bad hostname 'www.nodeworks.com')". It seems got something to do my proxy server failed to resolve the url address for some sites only, I got no ieda why. Could it have anything to do with the site I'm trying to access? Enclose below are call traces and source code, which I hope will give you some idea what's happened and hopefully, someone might be point out what's might be wrong. Any help and advice is much appreciated. Regards, WWang 8<-- LWP::UserAgent::new: () LWP::UserAgent::request: () LWP::UserAgent::send_request: POST https://login.yahoo.com/config/login?3tuqsj3uiso3a LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 120 bytes LWP::UserAgent::request: Simple response: Found .. With exactly the same syntax, only chage destination site url, I've got: 8<-- LWP::UserAgent::request: () LWP::UserAgent::send_request: GET https://www.nodeworks.com LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::UserAgent::request: Simple response: Internal Server Error 500 (Internal Server Error) Can't connect to www.nodeworks.com:443 (Bad hostname 'www.nodeworks.com') Client-Date: Thu, 19 Dec 2002 06:15:12 GMT 8<-- ## # source codes use LWP::UserAgent; use LWP::Debug qw(level); level('+'); $ua = new LWP::UserAgent; ## # PROXY SUPPORT for SSLeay module $ENV{HTTPS_PROXY} = '127.0.0.1:8080'; $ENV{HTTPS_PROXY} = 'http://xxx:93'; $ENV{HTTP_PROXY} = 'http://YYY:3128'; my $req = new HTTP::Request 'POST','https://login.yahoo.com/config/login?3tuqsj3uiso3a'; $req->content_type('form-data'); $req->content('login=xxx&passwd=x'); my $res = $ua->request($req); print $res->as_string; ## # 500 (Internal Server Error) Can't connect to . my $req = new HTTP::Request 'GET','https://www.nodeworks.com'; my $res = $ua->request($req); print $res->as_string; 8<-- ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Helps needed with POST
Greetings, I'm a C++ programmer and It's my first attempt to code in perl. I'm behind a firewall and access WWW via a proxy server. I got no problem to GET a request from a web site by using LWP::UserAgent, if I have the correct proxy setting. I tried to do it in a similar way with POST request, but failed. What I've done is: -8<- use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->proxy (['http'] => 'http://123.123.123.134:ppp'); $ua->proxy (['https'] => 'http://123.123.123.134:ppp'); my $req = POST 'https://www.somesite.com/somefile.asp', [ LoginName => mylogin, Password => mypassword ]; print $ua->request($req)->as_string; -8<- The request is returned successfully(HTTP/1.0 200 OK), but complains "No Server". I suspect it's something wrong with my proxy. Could someone point me to the right direction on how to deal with proxy server and HTTPS site? TIA WWang ___ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs