this repo has no description
1opam-version: "2.0"
2description: """
3Mechaml is a functional web scraping library that allows to :
4* Fetch web content
5* Analyze, fill and submit HTML forms
6* Handle cookies, headers and redirections
7
8Mechaml is built on top of existing libraries that provide low-level features : [Cohttp](https://github.com/mirage/ocaml-cohttp) and
9[Lwt](https://github.com/ocsigen/lwt) for asynchronous I/O and HTTP handling, and
10[Lambdasoup](https://github.com/aantron/lambda-soup) to parse HTML. It provides
11an interface that handles the interactions between these and add a few
12other features.
13
14## Overview
15
16The library is divided into 3 main modules :
17* Agent : User-agent features. Perform requests, get back content, headers, status code, ...
18* Cookiejar : Cookies handling
19* Page : HTML parsing and forms handling
20
21The Format module provides helpers to manage the formatted content in forms such
22as date, colors, etc. For more details, see the [documentation](https://yannham.github.io/mechaml/)
23
24## Installation
25
26### From opam
27```
28opam install mechaml
29```
30
31### From source
32Mechaml uses the dune build system, which can be installed through opam. Then,
33just run
34```
35dune build
36```
37to build the library.
38
39Use `dune build @doc` to generate the documentation, `dune runtest` to build and
40execute tests, and `dune build examples/XXX.exe` to compile example XXX.
41
42## Usage
43
44Here is sample of code that fetches a web page, fills a login form and submits
45it in the monadic style:
46
47```ocaml
48open Mechaml
49module M = Agent.Monad
50open M.Infix
51
52let require msg = function
53 | Some a -> a
54 | None -> failwith msg
55
56let action_login =
57 Agent.get "http://www.somewebsite.com"
58 >|= Agent.HttpResponse.page
59 >|= (function page ->
60 page
61 |> Page.form_with "[name=login]"
62 |> require "Can't find the login form !"
63 |> Page.Form.set "username" "mynick"
64 |> Page.Form.set "password" "@xlz43")
65 >>= Agent.submit
66
67let _ =
68 M.run (Agent.init ()) action_login
69```
70
71More examples are available in the dedicated folder."""
72maintainer: "Yann Hamdaoui <yann.hamdaoui@gmail.com>"
73authors: "Yann Hamdaoui <yann.hamdaoui@gmail.com>"
74license: "LGPL-3.0-only"
75homepage: "https://github.com/yannham/mechaml"
76doc: "https://yannham.github.io/mechaml/"
77bug-reports: "https://github.com/yannham/mechaml/issues"
78depends: [
79 "dune" {>= "1.1.0"}
80 "cohttp" {>= "0.21.0" & < "2.0.0"}
81 "cohttp-lwt"
82 "cohttp-lwt-unix"
83 "lwt"
84 "uri" {< "3.0.0"}
85 "lambdasoup" {< "0.7.0"}
86 "alcotest" {with-test & >= "0.8.0" & < "1.4.0"}
87 "ocaml" {>= "4.03.0"}
88]
89build: [
90 ["dune" "build" "-p" name "-j" jobs]
91 ["dune" "runtest" "-p" name "-j" jobs] {with-test}
92 ["make doc"] {with-doc}
93]
94dev-repo: "git+https://github.com/yannham/mechaml.git"
95url {
96 src:
97 "https://github.com/yannham/mechaml/releases/download/v1.1.0/mechaml-v1.1.0.tbz"
98 checksum: [
99 "sha256=9071f8ebeeaf438427ce401ddaf3acc7231a24108af63128cd52b07b239e7f70"
100 "md5=6ce800fbcdd8bdb53c84fb5e4bfb0329"
101 ]
102}
103synopsis: ""