Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun extract-next-page-number (stppage)
- (flet ((tiny-cells (stpnode)
- (stp:filter-recursively
- #'(lambda (x) (and (typep x 'stp:element)
- (equal (stp:local-name x) "td")
- (equal (stp:attribute-value x "class") "tiny"))) stpnode))
- (next-link (stptiny)
- (stp:find-recursively-if
- #'(lambda (x) (and (typep (stp:first-child x) 'stp:text)
- (equal (stp:data (stp:first-child x)) "next >")))
- (second stptiny)))
- (href (stphref) (stp:attribute-value stphref "href")))
- (let ((nexthref (next-link (tiny-cells stppage))))
- (if (not (null nexthref))
- (let ((nexturl (href nexthref)))
- (parse-integer (subseq nexturl (1- (length nexturl)))))))))
Advertisement
Add Comment
Please, Sign In to add comment