[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

PhantomJS



Hi.

I recently stumbled across PhantomJS, which is something I have actually
been wishing for a long time already.  I remember that we had a thread
on JavaScript support in text-mode recently again, so this seems like
something that should be mentioned.  Mind you, PhantomJS is not a usable
text-browser in any way, but it is a command-line/script driven
interface to a WebKit engine, which can be used to programmatically
interact with a full-featured and rather modern web browser.  This is
mostly useful to do web automation.  So you can quite easily write
scripts which do stuff on the web for you, once you found your way
around in the several APIs involved.  There are a few interesting
example scripts included, which do useful stuff, like ask Google Maps
for directions, and print the result on the console.

So again, this is not really a finished solution, but I guess it can be
helpful at times if we are stuck in a situation where a good JavaScript
capable browser is needed.  At least we can write scripts now to poke
around, and maybe even automate a frequent task to get a neat
command-line tool to do the work for us.

One idea that comes to mind though, is to try and re-implement a
text-browser on top of PhantomJS (or any other capable headless
browser).  I guess a rewrite of edbrowse, for instance, could be done
purely in PhantomJS.  Actually, I didn't even check how edbrowse is
doing things these days, they might already have a similar approach.
However, a lynx or elinks-alike interface seems quite involved.  For
one, PhantomJS does not offer any curses-bindings, so these might
probably need to get written first.  But from there on, chances are
quite good that we could get a useful modern text browser going on top
of a headless engine like PhantomJS.

Any takers? :-)

-- 
CYa,
  ⡍⠁⠗⠊⠕ | Debian Developer <URL:http://debian.org/>
  .''`. | Get my public key via finger mlang/key@db.debian.org
 : :' : | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44
 `. `'
   `-      <URL:http://delysid.org/>  <URL:http://www.staff.tugraz.at/mlang/>

Attachment: pgpkB3MfoqCrL.pgp
Description: PGP signature


Reply to: