We've used Rhino for years with our own custom-built browser to visit a
set of sites that changes over time, with a dynamic set of variables
that change for each site.
Sometimes I might want to use one browser, sometimes another; sometimes
I want to go down one path on a site, sometimes another way. Because we
interact with a number of dynamic sites who change their content and
even the path to get to things changes pretty often, we need to alter
the way the browsers act almost daily.
However, the custom-built browser we made doesn't handle everything the
way Firefox or IE would, it is missing support for a number of things,
especially AJAX/Javascript related things.
I've been looking at using HtmlUnit, which uses Rhino as its Javascript
engine to replace our custom browser. To me the power of HtmlUnit is
that it runs a virtual browser and is supposed to be able to act just
like IE or Firefox when it hits a site.
So I'm trying to figure out my options related to Rhino.
1) I could setup some sort of Java (or maybe even JavaScript) front-end
in front of HtmlUnit that is able to somehow drive the virtual browsers
based on the input that I put into a database. I'd need to be able to
abstract HtmlUnit's actions somehow so that it could be told to do X one
time and Y another time.
2) I could hard code Java classes for each different path I run into, or
at least mostly hard code it, with less ability to have dynamic actions.
Hopefully I'd be able to find common actions that could be hard coded
while still finding some things that could be variable-driven.
3) I could find something else besides HtmlUnit to plug in as a browser
(like maybe apache's HttpConnection classes). The main requirement is
that it has to be able to act as closely as possible to being a real
browser such as IE or Firefox, like HtmlUnit can. Yet, I hope to be able
to script it like we currently do with Rhino or some other easily
modifiable front-end that can be compiled on the fly or interpreted at
run-time.
Any suggestions on how Rhino should be used in this situation? I was
thinking of possibly building a scripting front end so Rhino would be on
the front end and the back end. Is there a better way to allow for a
dynamic driver for HtmlUnit or another virtual browser with a complete
DOM that I'm not aware of? I would use just straight Rhino if it
supported the browser DOM objects, but it doesn't.
Does anyone have experience with this sort of thing? We may be willing
to hire someone on a contract basis.
Thanks,
Daniel Gibby
P.S. I sent out a similar message on the HtmlUnit list, so if you are on
both, pipe up in the location you think is more appropriate.
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino