Grabbing web pages
Last updated at 3:13 pm UTC on 14 January 2006
You can always "inspect" this (or tack an "inspect" on the end of the chain) to peek at the contents.
'http://www.squeak.org/' asUrl retrieveContents.
I often pop the content of the retrieved page into the clipboard:
Clipboard clipboardText: 'http://www.squeak.org/' asUrl retrieveContents content.
Purpose: fetches a given page and displays it in its own window.
HTTPSocket httpShowPage: 'http://www.cc.gatech.edu/fac/mark.guzdial/squeak/'
Purpose: Fetches a given image and displays it in its own window.
HTTPSocket httpShowGif: 'http://www.cc.gatech.edu/fac/mark.guzdial/squeak/images/sqlogo.gif'
Purpose: Downloads the document referenced by a URL and returns a MIMEDocument. MIMEDocuments can then be queried for their MIME contentType and for their binary content.
'http://minnow.cc.gatech.edu/files/squeak/squeak.gif' asUrl retrieveContents