> 
> Now if we can just figure out a logical way to lash all
> this together. . .

I've been working on a Web::Browser module to be a "tie together" class for 
LWP::UserAgent and JavaScript.pm.  It is intended to be a high-level 
interface to web automation, plus an easier way to manipulate web page 
contents using a well-known interface (the same one used by javascript).
It will require two more modules at least: an implementation of the HTML 
Document Object Model and a set of bindings from the DOM to JavaScript.

My initial code can do things like:
$browser->document->forms(0)->set_value('username' => 'me');
$browser->document->forms(0)->submit();
or
$browser->document->link(14)->click();

which will load the page as the new document in $browser, but it is hacked 
together (from HTML::Form, HTML::LinkExtor, HTML::TreeBuilder, etc) and 
inflexible, so I started working on an HTML::DOM module built from the W3C 
Document Object Model (HTML) Level 1 specification to inherit from XML::DOM 
[which is based on the DOM (Core) Level 1].  I also have some code which 
"publishes" part of the HTMLDocument object to a JavaScript.pm created 
runtime/context and manipulates it from JavaScript code.  

Do you think this is a good way to go about it?  When it's done, I expect to 
have 6 core modules sharing the work:
Web::Browser                    # High level interaction / Controller
LWP::UserAgent                  # (The real work) HTTP / Network manipulation
HTML::TreeBuilder               # HTML Parsing into HTML::DOM
HTML::DOM                               # Document representation
HTML::DOM::JSBindings           # JavaScript links to document
JavaScript                              # JavaScript processing engine

Three of them are already available on CPAN, so I'm currently focusing on 
implementing the HTML::DOM module.

Any comments?

-Tom

Reply via email to