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 80
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 186.1 ms (175.3 ms .. 194.6 ms)
27 0.999 R² (0.995 R² .. 1.000 R²)
28 mean 191.7 ms (188.9 ms .. 198.3 ms)
29 std dev 5.053 ms (1.092 ms .. 6.809 ms)
30 variance introduced by outliers: 14% (moderately inflated)
32 benchmarking Forced/tagsoup normal Text
33 time 189.7 ms (182.8 ms .. 197.7 ms)
34 0.999 R² (0.998 R² .. 1.000 R²)
35 mean 196.5 ms (193.1 ms .. 202.1 ms)
36 std dev 5.481 ms (2.141 ms .. 7.383 ms)
37 variance introduced by outliers: 14% (moderately inflated)
39 benchmarking Forced/html-parser
40 time 15.81 ms (15.75 ms .. 15.89 ms)
41 1.000 R² (1.000 R² .. 1.000 R²)
42 mean 15.72 ms (15.66 ms .. 15.77 ms)
43 std dev 140.9 μs (113.6 μs .. 174.5 μs)
46homepage: http://github.com/bgamari/html-parse
50maintainer: ben@smart-cactus.org
51copyright: (c) 2016 Ben Gamari
55tested-with: GHC==8.4.*, GHC==8.6.*, GHC==8.8.*, GHC==8.10.*, GHC==9.0.*, GHC==9.2.*, GHC==9.4.*, GHC==9.6.*
56extra-source-files: changelog.md
61 location: git://github.com/bgamari/html-parse
64 exposed-modules: Text.HTML.Parser, Text.HTML.Tree
65 other-modules: Text.HTML.Parser.Entities, Data.Trie
68 other-extensions: OverloadedStrings, DeriveGeneric
69 build-depends: base >=4.7 && <4.19,
70 deepseq >=1.3 && <1.5,
71 attoparsec >=0.13 && <0.15,
73 containers >=0.5 && <0.7
74 default-language: Haskell2010
77 type: exitcode-stdio-1.0
79 other-extensions: OverloadedStrings, DeriveGeneric
87 default-language: Haskell2010
90 type: exitcode-stdio-1.0
93 other-modules: Text.HTML.ParserSpec, Text.HTML.TreeSpec
94 ghc-options: -Wall -with-rtsopts=-T
95 build-tool-depends: hspec-discover:hspec-discover
102 quickcheck-instances,
105 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