I use this function to connect at a URL and get the html code of the page referenced by the URL. my problem is that the html code that I receive is not all of the code of the page
(defun connect-to-url (url filename)
(ext:with-http-input (stream url)
(with-open-file (stream2 filename :direction :output
:if-exists :overwrite
:if-does-not-exist :create )
(loop for line = (read-line stream nil nil)
while line
do (format stream2 line)))))
problem with my lisp function
Re: problem with my lisp function
Here are a couple posting suggestions; unfortunately I don't have a system handy to test your problem.
First, specify which non-core packages you are using (e.g. where ext:with-http-input comes from).
Second, use the "" blocks, good indentation, and preview so we don't have to specially parse
.
First, specify which non-core packages you are using (e.g. where ext:with-http-input comes from).
Second, use the "
Code: Select all

-
- Posts: 13
- Joined: Fri Dec 04, 2009 1:30 pm
Re: problem with my lisp function
Code: Select all
(defun connect-to-url (url filename)
(ext:with-http-input (stream url)
(with-open-file (stream2 filename :direction :output
:if-exists :overwrite
:if-does-not-exist :create )
(loop for line = (read-line stream nil nil)
while line
do (format stream2 line)))))
-
- Posts: 13
- Joined: Fri Dec 04, 2009 1:30 pm
Re: problem with my lisp function
Code: Select all
(defun connect-to-url (url filename)
(ext:with-http-input (stream url)
(with-open-file (stream2 filename :direction :output
:if-exists :overwrite
:if-does-not-exist :create )
(loop for line = (read-line stream nil nil)
while line
do (format stream2 line)))))
I have run it on the Clisp and my problem is that it not return all the contain of the web page
Re: problem with my lisp function
Other than stripping out line breaks, it works for me.
Your code is very similar to
http://rosettacode.org/wiki/HTTP_Request#Common_Lisp
Maybe there is a character-set issue on the page you are trying to read?
Your code is very similar to
http://rosettacode.org/wiki/HTTP_Request#Common_Lisp
Maybe there is a character-set issue on the page you are trying to read?