My question is related to another question found here Scraping an HTML table in Common Lisp?
I am trying to extract data from a webpage in common lisp. I am currently using drakma to send the http request, and I'm trying to use chtml to extract the data I am looking for. The webpage I'm trying to scrap is http://erg.delph-in.net/logon, here is my code
(defun send-request (sentence)
"sends sentence in an http request to logon for parsing, and recieves
back the webpage containing the MRS output"
(drakma:http-request "http://erg.delph-in.net/logon"
:method :post
:parameters `(("input" . ,sentence)
("task" . "Analyze")
("roots" . "sentences")
("output" . "mrs")
("exhaustivep" . "best")
("nresults" . "1"))))
And here's the function I am having trouble with
(defun get-mrs (sentence)
(let* (
(str (send-request sentence))
(document (chtml:parse str (cxml-stp:make-builder))))
(stp:filter-recursively (stp:of-name "mrsFeatureTop") document)))
Basically all the data I need to extract is in an html table, it's too big to paste here though. In my get-mrs function, i was just trying to get the tag with name mrsFeatureTop, I am not sure if this is correct though since I am getting an error: not an NCName 'onclick. Any help with scraping the table will be greatly appreciated. Thank you.