Skip to content
WWW::Mechanize work-alike for Common Lisp
Common Lisp
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore Add .gitignore
COPYING Bump copyright year README: a stronger warning about the usability of this package
cl-mechanize.asd Initial commit
cl-mechanize.lisp Add configuration variables for controlling cookies


CL-MECHANIZE is a WWW::Mechanize work-alike for Common Lisp implemented as a thin wrapper on top of Drakma.

This package is still in the early stages of development. Please read the source before using; do not expect this to do anything useful.


git clone git:// cl-mechanize

Use QuickLisp to easily install the dependencies.


$ lisp

;; Add system definition to the ASDF search path
(pushnew (merge-pathnames "relative/path/to/cl-mechanize"

;; Load system
(asdf:operate 'asdf:load-op :cl-mechanize)
(in-package :cl-mechanize-user)

;; Create browser object
(defvar *browser* (make-instance 'browser)

;; Do a google search
(fetch "" *browser*)

(let* ((page (browser-page *browser*))
       (search-form (car (page-forms page))))
  (setf (form-inputs search-form)
        '(("q" . "google")))
  (submit search-form *browser*)

  (let ((results (browser-page *browser*)))
    (format t "~A~%" (ppcre:all-matches-as-strings "<title>[a-z].*</title>"
                                                 (page-content results)))
    (dolist (link (page-links results))
      (format t "~A~%" (link-text link)))

    ;; Traverse the DOM
    (stp:do-recursively (n (page-dom results))
Something went wrong with that request. Please try again.