3synopsis: A high-performance HTML tokenizer
5 This package provides a fast and reasonably robust HTML5 tokenizer built
6 upon the @attoparsec@ library. The parsing strategy is based upon the HTML5
7 parsing specification with few deviations.
11 >>> parseTokens "<div><h1 class=widget>Hello World</h1><br/>"
13 TagOpen "h1" [Attr "class" "widget"],
14 ContentText "Hello World",
18 The package targets similar use-cases to the venerable @tagsoup@ library,
19 but is significantly more efficient, achieving parsing speeds of over 50
20 megabytes per second on modern hardware and typical web documents.
21 Here are some typical performance numbers taken from parsing a Wikipedia
22 article of moderate length:
25 benchmarking Forced/tagsoup fast Text
26 time 171.2 ms (166.4 ms .. 177.3 ms)
27 0.999 R² (0.997 R² .. 1.000 R²)
28 mean 171.9 ms (169.4 ms .. 173.2 ms)
29 std dev 2.516 ms (1.104 ms .. 3.558 ms)
30 variance introduced by outliers: 12% (moderately inflated)
32 benchmarking Forced/tagsoup normal Text
33 time 176.9 ms (167.3 ms .. 188.5 ms)
34 0.998 R² (0.994 R² .. 1.000 R²)
35 mean 180.7 ms (177.5 ms .. 183.7 ms)
36 std dev 4.246 ms (2.316 ms .. 5.803 ms)
37 variance introduced by outliers: 14% (moderately inflated)
39 benchmarking Forced/html-parser
40 time 20.88 ms (20.60 ms .. 21.25 ms)
41 0.999 R² (0.998 R² .. 0.999 R²)
42 mean 20.99 ms (20.81 ms .. 21.20 ms)
43 std dev 446.1 μs (336.4 μs .. 596.2 μs)
46homepage: http://github.com/bgamari/html-parse
50maintainer: ben@smart-cactus.org
51copyright: (c) 2016 Ben Gamari
55tested-with: GHC==8.0.2, GHC==7.10.3, GHC==7.8.4
60 location: git://github.com/bgamari/html-parse
63 exposed-modules: Text.HTML.Parser, Text.HTML.Tree
65 other-extensions: OverloadedStrings, DeriveGeneric
66 build-depends: base >=4.7 && <4.11,
67 deepseq >=1.3 && <1.5,
68 attoparsec >=0.13 && <0.14,
70 containers >=0.5 && <0.6
71 default-language: Haskell2010
74 type: exitcode-stdio-1.0
76 other-extensions: OverloadedStrings, DeriveGeneric
83 default-language: Haskell2010
86 type: exitcode-stdio-1.0
89 other-modules: Text.HTML.ParserSpec, Text.HTML.TreeSpec
90 ghc-options: -Wall -with-rtsopts=-T
100 default-language: Haskell2010
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list