Test do-http-request

AServe defines some functions for getting web pages. The simplest to use is do-http-request in the net.aserve.client package.

To try it, type

(net.aserve.client:do-http-request url)

to read a web page. Pick a page that's not too long. If it succeeds, you should get back a string with the contents of the entire page. If you get an error message, try another page. I've had some trouble with URL's that leave out the file name, though an address with search keys, such as you see on Google, should work.

Get and test parse-html

Get the open source version of the HTML parser from http://opensource.franz.com. This comes packaged with an XML parser, but we'll use a different one in this course. Extract the files into your CS 325 library. The file with the HTML parser to load is phtml.cl.

Now do

(net.html.parser:parse-html (net.aserve.client:do-http-request ...))

to test parsing the HTML returned by the URL you tried before. You should get back a list version of the page, i.e., a version you can process with standard Lisp list functions.

Submit Report

Email to c-riesbeck@northwestern.edu

Where to get help

As before, the best source of help will be the CS 325 news server.


Comments? Comments icon Send mail to Chris Riesbeck. Put EECS 325 in the Subject.