Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18651

Re: Automatically driving a browser

Message-ID <6373251.ZMB7bVNzcP@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2013-02-27 16:45 +0100
Subject Re: Automatically driving a browser
Newsgroups comp.lang.javascript
References <pBE*2C4su@news.chiark.greenend.org.uk>

Show all headers | View raw


Theo Markettos wrote:

> Is there any means of programmatically operating a browser - for example,
> inspecting the DOM, click on links it finds, waiting for the next page to
> load, enter some text into a form, submit it, etc etc?  By this I mean the
> browser is operating as normal (with a UI) not as a perl script that's
> doing HTTP itself.

In theory, there is the possibility that you can access documents in other 
frames, you can call access properties of element objects, and you can 
create events and propagate them to elements.  In practice, that possibility 
is limited by the Same Origin Policy (SOP).

However, it is possible to use a non-standard host environment, such as a 
user profile for testing (and only for that) with sufficiently low (but not 
lower) security settings.  I suspect that it also could be done with a 
browser extension since that is running in a privileged context.

Or you could perhaps run all foreign traffic through a transparent HTTP 
proxy so that the SOP is not an issue despite strong security settings.

The simplest thing to do is, of course, to use the script console on the 
site that you are testing.  I have not yet tried what you could call “cross-
site driving”, though.
 
> I've seen things like Google Scraper which poke about in the HTML
> hierarchy, but do tools/scripts for actually operating a browser as well
> exist?

Probably yes.  Have you searched for them?

> I'm guessing Javascript is the most likely starting point,

There is no Javascript.  <http://PointedEars.de/es-matrix>

> since it has access to the DOM already, though any other language is fine
> too.  Am happy to be tied to a specific browser, it doesn't need to be
> generic.

In that case Firefox or in general Gecko-based environments are the most 
likely candidates.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Automatically driving a browser Theo Markettos <theom+news@chiark.greenend.org.uk> - 2013-02-27 14:48 +0000
  Re: Automatically driving a browser Christoph Becker <cmbecker69@gmx.de> - 2013-02-27 15:53 +0100
    Re: Automatically driving a browser Theo Markettos <theom+news@chiark.greenend.org.uk> - 2013-02-28 00:34 +0000
      Re: Automatically driving a browser Stefan Weiss <krewecherl@gmail.com> - 2013-02-28 17:33 +0100
  Re: Automatically driving a browser Bjoern Hoehrmann <bjoern@hoehrmann.de> - 2013-02-27 15:57 +0100
    Re: Automatically driving a browser Theo Markettos <theom+news@chiark.greenend.org.uk> - 2013-02-27 15:14 +0000
      Re: Automatically driving a browser Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-02-27 22:38 +0100
        Re: Automatically driving a browser Theo Markettos <theom+news@chiark.greenend.org.uk> - 2013-02-28 00:43 +0000
  Re: Automatically driving a browser Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-27 16:45 +0100

csiph-web