* Get a page from the Web
@ 2005-11-07 21:19 Martin Chabr
2005-11-07 21:35 ` [Caml-list] " Karl Zilles
2005-11-07 22:10 ` Florian Weimer
0 siblings, 2 replies; 7+ messages in thread
From: Martin Chabr @ 2005-11-07 21:19 UTC (permalink / raw)
To: caml-list
Hello,
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?
Regards,
Martin
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] Get a page from the Web
2005-11-07 21:19 Get a page from the Web Martin Chabr
@ 2005-11-07 21:35 ` Karl Zilles
2005-11-07 22:10 ` Florian Weimer
1 sibling, 0 replies; 7+ messages in thread
From: Karl Zilles @ 2005-11-07 21:35 UTC (permalink / raw)
To: Martin Chabr; +Cc: caml-list
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/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] Get a page from the Web
2005-11-07 21:19 Get a page from the Web Martin Chabr
2005-11-07 21:35 ` [Caml-list] " Karl Zilles
@ 2005-11-07 22:10 ` Florian Weimer
2005-11-08 10:40 ` Richard Jones
1 sibling, 1 reply; 7+ messages in thread
From: Florian Weimer @ 2005-11-07 22:10 UTC (permalink / raw)
To: Martin Chabr; +Cc: caml-list
* 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)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] Get a page from the Web
2005-11-07 22:10 ` Florian Weimer
@ 2005-11-08 10:40 ` Richard Jones
2005-11-09 18:13 ` Ant: " Martin Chabr
0 siblings, 1 reply; 7+ messages in thread
From: Richard Jones @ 2005-11-08 10:40 UTC (permalink / raw)
To: caml-list
And yet another way is to use perl4caml[1] and WWW::Mechanize[2] which
is wrapped by perl4caml. This allows you to fairly easily navigate
websites (click links, push buttons, fill in forms and so on).
Rich.
[1] http://merjis.com/developers/perl4caml/
[2] http://search.cpan.org/dist/WWW-Mechanize/lib/WWW/Mechanize.pm
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Ant: Re: [Caml-list] Get a page from the Web
2005-11-08 10:40 ` Richard Jones
@ 2005-11-09 18:13 ` Martin Chabr
0 siblings, 0 replies; 7+ messages in thread
From: Martin Chabr @ 2005-11-09 18:13 UTC (permalink / raw)
To: Richard Jones; +Cc: caml-list
Many thanks to all of you for the information!
Martin
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Ant: Re: [Caml-list] Get a page from the Web
2005-11-07 21:47 ` Martin Chabr
@ 2005-11-07 22:09 ` Eric Cooper
0 siblings, 0 replies; 7+ messages in thread
From: Eric Cooper @ 2005-11-07 22:09 UTC (permalink / raw)
To: caml-list
On Mon, Nov 07, 2005 at 10:47:02PM +0100, Martin Chabr wrote:
> --- Karl Zilles <zilles@1969web.com> schrieb:
> > http://sourceforge.net/projects/ocurl/
Here are two other ways: the ocamlnet package has an HTTP client,
or you can use Unix.open_process_in with "curl" or "wget".
--
Eric Cooper e c c @ c m u . e d u
^ permalink raw reply [flat|nested] 7+ messages in thread
* Ant: Re: [Caml-list] Get a page from the Web
[not found] <436FC866.4090709@1969web.com>
@ 2005-11-07 21:47 ` Martin Chabr
2005-11-07 22:09 ` Eric Cooper
0 siblings, 1 reply; 7+ messages in thread
From: Martin Chabr @ 2005-11-07 21:47 UTC (permalink / raw)
To: Karl Zilles; +Cc: caml-list
That was fast! Thank you, Karl, I will have a look.
Martin
--- Karl Zilles <zilles@1969web.com> schrieb:
> Martin Chabr wrote:
> > Hello,
> >
> > 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/
>
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-11-09 18:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-07 21:19 Get a page from the Web Martin Chabr
2005-11-07 21:35 ` [Caml-list] " Karl Zilles
2005-11-07 22:10 ` Florian Weimer
2005-11-08 10:40 ` Richard Jones
2005-11-09 18:13 ` Ant: " Martin Chabr
[not found] <436FC866.4090709@1969web.com>
2005-11-07 21:47 ` Martin Chabr
2005-11-07 22:09 ` Eric Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox