From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B0983BB9A for ; Mon, 7 Nov 2005 22:26:36 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jA7LQad9028747 for ; Mon, 7 Nov 2005 22:26:36 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA18491 for ; Mon, 7 Nov 2005 22:26:35 +0100 (MET) Received: from woodstock.1969.ws (64-215-156-42.eosinc.net [64.215.156.42]) by nez-perce.inria.fr (8.13.0/8.13.0) with SMTP id jA7LQYKZ012122 for ; Mon, 7 Nov 2005 22:26:34 +0100 Received: (qmail 2461 invoked from network); 7 Nov 2005 21:26:33 -0000 Received: from unknown (HELO ?10.3.2.15?) (10.3.2.15) by 0 with SMTP; 7 Nov 2005 21:26:33 -0000 Message-ID: <436FC8BD.90801@1969web.com> Date: Mon, 07 Nov 2005 13:35:57 -0800 From: Karl Zilles Organization: 1969 Communications, Inc. User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Martin Chabr Cc: caml-list@inria.fr Subject: Re: [Caml-list] Get a page from the Web References: <20051107211906.14100.qmail@web26810.mail.ukl.yahoo.com> In-Reply-To: <20051107211906.14100.qmail@web26810.mail.ukl.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 436FC68C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 436FC68A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 ocaml:01 curl:98 wrote:01 sourceforge:01 binding:02 python:02 library:03 martin:10 something:12 snippet:13 www:85 using:15 handle:15 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 Martin Chabr wrote: > I have been looking for ways to get a page in HTML > from the Web, using an OCaml program, something like > the following Python snippet: > > import urllib > URL = "http://www.ibm.com" > url = urllib.urlopen(URL) > html = url.read() > > You supply the URL and receive the page in HTML. Is > there anything simple like that in OCaml? I use the Ocaml binding to the curl library. It has worked well for me and it can handle high level details like maintaining cookies across calls (for session continuity and logins): http://sourceforge.net/projects/ocurl/