English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Get a page from the Web
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-07 (22:10)
From: Florian Weimer <fw@d...>
Subject: Re: [Caml-list] Get a page from the Web
* Martin Chabr:

> import urllib
> URL = "http://www.ibm.com"
> url = urllib.urlopen(URL)
> html = url.read()

You could use the Netclient library:

let s = Http_client.Convenience.http_get "http://www.ibm.com" in
  output_string stdout s

(Compile with: ocamlfind ocamlc -package netclient -linkpkg file.ml)