Home > Webkitd

Webkitd

Webkitd is a project mainly written in PYTHON and PHP, based on the GPL-3.0 license.

A headless webkit daemon written in python

Webkitd - A headless webkit daemon written in python Copyright (C) 2011 The Pickling Jar Ltd http://www.thepicklingjar.com/ http://www.thepicklingjar.com/code/webkitd/

Version 0.3.0 (Alpha - expect bugs)

Requirements

python 2.6+ http://www.python.org QT 4.6.3+ Framework only http://qt.nokia.com/downloads/downloads#lgpl SIP http://www.riverbankcomputing.com/software/sip/download pyqt http://www.riverbankcomputing.co.uk/software/pyqt/download pyquery http://pypi.python.org/pypi/pyquery spynner 0.0.3 (modified) - See depends directory: install with - cd depends/spynner-0.0.3; sudo python setup.py install Xvfb (X windows virtual framebuffer) - Install (centos) yum install xorg-x11-server-Xvfb

Starting Webkitd

./scripts/xvfb-run.sh python2.6 webkitd.py

Using Webkitd

The syntax is COMMAND-SPACE-ARGUMENTS

Basic usage is along of the lines of the following

nc 127.0.0.1 3817 <-- connect to Webkitd using netcat

1 http://www.thepicklingjar.com <-- Command 1 sets the url to load 13 <-- Command 13 executes request 15 <-- Command 15 returns the html, all links are resolved to full paths 16 _jQuery('#content').html('test text'); <-- Command 16 runs jQuery, updating content div with "test text" 15 <-- Command 15 returns the html after javascript has run

Note: Some commands return binary data with the length followed by the data thus you may want to script webkitd with a language such as php. See examples/webkitdclient.php for an overview

Howto

See examples directory for a php interface to Webkitd

Notes

Not as headless as we'd like but running with a framebuffer fixed the rendering of certain sites (fifa.com for example).

The usual Jquery selector $() should be replaced with _jQuery to use the internal copy of jquery

Previous:test-project