RE: Open IE and fill out a Web-Form

2005-09-05 Thread Wenjie Wang
: 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: Open IE and fill out a Web-Form

2005-09-02 Thread Thomas, Mark - BLS CTR
Peter wrote:
 All that is to do is open a website,

use WWW::Mechanize;
my $mech = WWW::Mechanize-new();
$mech-get($url);

 enter Login and Password,

# assuming there's one form with only two visible fields:
$mech-set_visible( 'login_name', 'password');

 click on Login-Button,

$mech-submit;

 wait for new page, click on some link

$mech-follow_link( text_regex = qr/Click Here/i );

 and fill out a form with text-fields and a dropdown menu 

$mech-set_visible( foo, bar, [ option = Dropdown_item_3 ]);

 and then click Send-Button...

$mech-submit;

 But to use Mechanize I think I'd have to understand programming the 
 HTML-code myself or have the source-code.

If you want to fill out only specific fields, then you'll have to do a View
Source and look at the name=foo value for the fields you want to set.
Then you use $mech-set_fields instead of set_visible. But that's not hard.

 Thanks for any help (If you had a piece of code ready somewhere that 
 does something similar I'd like to work through that, but 
 understanding Mechanize from scrap - oh boy.)

Yes, it's a long doc but it's easy to understand, once you get how it works.

Hope this helps.

-- 
Mark Thomas 
Internet Systems Architect
___
BAE SYSTEMS Information Technology 
2525 Network Place
Herndon, VA  20171  USA 

___
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Open IE and fill out a Web-Form

2005-09-02 Thread Thomas, Mark - BLS CTR
 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.

-- 
Mark Thomas 
Internet Systems Architect
___
BAE SYSTEMS Information Technology 
2525 Network Place
Herndon, VA  20171  USA 

___
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Open IE and fill out a Web-Form

2005-09-01 Thread Thomas, Mark - BLS CTR
 I would have to open an IE window, open a URL, login to some 
 server that makes 
 heavy use of JavaScript, wait for feedback and then fill out 
 a form that has all kinds of 
 controls (text boxes, drop down boxes, buttons, etc).
 
 It seems not to be THAT simple (as usual with perl).

Thanks to Mechanize, it's easier in Perl than in any other language.

Normally I would just use WWW::Mechanize to do what you are asking. It can
automatically follow links, fill out forms, click buttons, etc. It keeps
track of cookies automatically, just like a real browser.

You may be able to use it just fine. If you are sure you need IE for some
reason (perhaps the javascript stuff) you can use Win32::IE::Mechanize,
which implements a similar interface but uses a Win32::OLE backend instead
of LWP::UserAgent.

-- 
Mark Thomas 
Internet Systems Architect
___
BAE SYSTEMS Information Technology 
2525 Network Place
Herndon, VA  20171  USA 

___
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Open IE and fill out a Web-Form

2005-09-01 Thread peter . pitton
Thanks Mark,

that's also good to know. 
Yes, on the page(s)[not my page] I would have to work with there is a 
whole lot of JavaScript.
I tried to read through the Mechanize stuff, but that's very very indepth 
stuff.
If there would be a sample of code I could try to understand and adapt.

All that is to do is open a website, enter Login and Password, click 
on Login-Button, wait for new page, click on some link and fill out a 
form with text-fields and a dropdown menu and then click Send-
Button...
But to use Mechanize I think I'd have to understand programming the 
HTML-code myself or have the source-code. 

Thanks for any help (If you had a piece of code ready somewhere that 
does something similar I'd like to work through that, but understanding 
Mechanize from scrap - oh boy.)

Best regards,

Peter



On 1 Sep 2005 at 9:11, Thomas, Mark - BLS CTR wrote:

  I would have to open an IE window, open a URL, login to some 
  server that makes 
  heavy use of JavaScript, wait for feedback and then fill out 
  a form that has all kinds of 
  controls (text boxes, drop down boxes, buttons, etc).
  
  It seems not to be THAT simple (as usual with perl).
 
 Thanks to Mechanize, it's easier in Perl than in any other language.
 
 Normally I would just use WWW::Mechanize to do what you are asking. It can
 automatically follow links, fill out forms, click buttons, etc. It keeps
 track of cookies automatically, just like a real browser.
 
 You may be able to use it just fine. If you are sure you need IE for some
 reason (perhaps the javascript stuff) you can use Win32::IE::Mechanize,
 which implements a similar interface but uses a Win32::OLE backend instead
 of LWP::UserAgent.
 
 -- 
 Mark Thomas 
 Internet Systems Architect
 ___
 BAE SYSTEMS Information Technology 
 2525 Network Place
 Herndon, VA  20171  USA 
 


___
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Open IE and fill out a Web-Form

2005-09-01 Thread wwangbigpond.net.au


 Thomas wrote: 
snap8---
 
 Thanks to Mechanize, it's easier in Perl than in any other language.
 
 Normally I would just use WWW::Mechanize to do what you are asking. It can
 automatically follow links, fill out forms, 
snap8---

Hi Thomas,

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.

--
Cheers,
WWang

+-Wenjie Wang ---+
| WANG Infonology Systems - Your Partner for the Future  |
| Phone : (02) 9871 2018  | [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: Open IE and fill out a Web-Form

2005-08-31 Thread Steven Manross
Sorry for the late reply..

IE is a duanting task to automate at first (It took me a couple months
to just get started beyond a simple navigate to feel comfortable in it),
but once you understand the object model, it's pretty easy to automate.

What you're asking to do is rather easy..

I'll give this sample for what it's worth -- since I am currently
looking for non-contract work, I figure this sample is appropriate. :)
Cheers to anyone it helps.

Yes, it doesn't fill any listboxes, but they are rather easy to do as
well once you understand the find_tag function.

Here's a link to the IE development manuals...  For after digesting the
functions code (and wanting more) -- shouldn't take you too long.

http://msdn.microsoft.com/workshop/index/default.asp

I'm in the middle of re-developing the InternetExplorer-Window module
and adding the functions.pm -- so you won't be able to find it on the
net..

The PMs are attached.  Please give positive/negative feedback if you are
interested in this subject and/or just want to.  :)

Steven

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, July 25, 2005 9:44 PM
To: perl-win32-web@listserv.ActiveState.com
Subject: Open IE and fill out a Web-Form

Hi everybody,

I would have to open an IE window, open a URL, login to some server that
makes heavy use of JavaScript, wait for feedback and then fill out a
form that has all kinds of controls (text boxes, drop down boxes,
buttons, etc).

Does anybody know a short HowTo or some simple sample code instead
of monstrous man-pages?

It seems not to be THAT simple (as usual with perl).

Thanks everybody,

Peter

___
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




sample.pl
Description: sample.pl


Window.pm
Description: Window.pm


Functions.pm
Description: Functions.pm
___
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs