You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update READMEs, add a small section on module layout, note all examples are written from top-level import, update the cachebust on pydocs from 8.1.2 to 8.1.8, clear trailing whitespace.
Copy file name to clipboardExpand all lines: README.md
+40-5Lines changed: 40 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
AdvancedHTMLParser
3
3
==================
4
4
5
-
AdvancedHTMLParser is an Advanced HTML Parser, with support for adding, removing, modifying, and formatting HTML.
5
+
AdvancedHTMLParser is an Advanced HTML Parser, with support for adding, removing, modifying, and formatting HTML.
6
6
7
7
It aims to provide the same interface as you would find in a compliant browser through javascript ( i.e. all the getElement methods, appendChild, etc), as well as many more complex and sophisticated features not available through a browser. And most importantly, it's in python!
8
8
@@ -27,7 +27,7 @@ Another useful scenario is creating automated testing suites which can operate m
27
27
Full API
28
28
--------
29
29
30
-
Can be found http://htmlpreview.github.io/?https://github.com/kata198/AdvancedHTMLParser/blob/master/doc/AdvancedHTMLParser.html?vers=8.1.2 .
30
+
Can be found http://htmlpreview.github.io/?https://github.com/kata198/AdvancedHTMLParser/blob/master/doc/AdvancedHTMLParser.html?vers=8.1.8 .
31
31
32
32
33
33
Examples
@@ -40,6 +40,41 @@ Short Doc
40
40
---------
41
41
42
42
43
+
**The Package and Modules**
44
+
45
+
The top-level module in this package is "*AdvancedHTMLParser*."
46
+
47
+
48
+
import AdvancedHTMLParser
49
+
50
+
51
+
Most everything "public" is available through this top-level module, but some corner-case usages may require importing from a submodule. All of these associations can be found through the pydocs.
52
+
53
+
54
+
For example, to access AdvancedTag, the recommended path is just to import the top-level, and use dot-access:
55
+
56
+
import AdvancedHTMLParser
57
+
58
+
myTag = AdvancedHTMLParser.AdvancedTag('div')
59
+
60
+
61
+
However, you can also import AdvancedTag through this top-level module:
62
+
63
+
import AdvancedHTMLParser
64
+
65
+
from AdvancedHTMLParser import AdvancedTag
66
+
67
+
68
+
Or, you can import from the specific sub-module, directly:
69
+
70
+
import AdvancedHTMLParser
71
+
72
+
from AdvancedHTMLParser.Tags import AdvancedTag
73
+
74
+
75
+
All examples below are written as if "import AdvancedHTMLParser" has already been performed, and all relations in examples are based off usages from the top-level import, only.
76
+
77
+
43
78
**AdvancedHTMLParser**
44
79
45
80
Think of this like "document" in a browser.
@@ -155,7 +190,7 @@ It also exposes the various getElement\* functions which operate on the elements
155
190
156
191
For example:
157
192
158
-
193
+
159
194
# Filter off the parser all tags with "item" in class
getPeersByAttr - Gets peers by an arbitrary attribute/value combination
219
254
220
-
getPeersWithAttrValues - Gets peers by an arbitrary attribute/values combination.
255
+
getPeersWithAttrValues - Gets peers by an arbitrary attribute/values combination.
221
256
222
257
getPeersByClassName - Gets peers that contain a given class name
223
258
@@ -412,7 +447,7 @@ InvalidAttributeNameException - An attribute name was found that contained an in
412
447
IndexedAdvancedHTMLParser
413
448
=========================
414
449
415
-
IndexedAdvancedHTMLParser provides the ability to use indexing for faster search. If you are just parsing and not modifying, this is your best bet. If you are modifying the DOM tree, make sure you call IndexedAdvancedHTMLParser.reindex() before relying on them.
450
+
IndexedAdvancedHTMLParser provides the ability to use indexing for faster search. If you are just parsing and not modifying, this is your best bet. If you are modifying the DOM tree, make sure you call IndexedAdvancedHTMLParser.reindex() before relying on them.
416
451
417
452
Each of the get\* functions above takes an additional "useIndex" function, which can also be set to False to skip index. See constructor for more information, and "Performance and Indexing" section below.
Copy file name to clipboardExpand all lines: README.rst
+40-5Lines changed: 40 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
AdvancedHTMLParser
3
3
==================
4
4
5
-
AdvancedHTMLParser is an Advanced HTML Parser, with support for adding, removing, modifying, and formatting HTML.
5
+
AdvancedHTMLParser is an Advanced HTML Parser, with support for adding, removing, modifying, and formatting HTML.
6
6
7
7
It aims to provide the same interface as you would find in a compliant browser through javascript ( i.e. all the getElement methods, appendChild, etc), as well as many more complex and sophisticated features not available through a browser. And most importantly, it's in python!
8
8
@@ -35,7 +35,7 @@ Another useful scenario is creating automated testing suites which can operate m
35
35
Full API
36
36
--------
37
37
38
-
Can be found http://htmlpreview.github.io/?https://github.com/kata198/AdvancedHTMLParser/blob/master/doc/AdvancedHTMLParser.html?vers=8.1.2 .
38
+
Can be found http://htmlpreview.github.io/?https://github.com/kata198/AdvancedHTMLParser/blob/master/doc/AdvancedHTMLParser.html?vers=8.1.8 .
39
39
40
40
41
41
Examples
@@ -48,6 +48,41 @@ Short Doc
48
48
---------
49
49
50
50
51
+
**The Package and Modules**
52
+
53
+
The top-level module in this package is "*AdvancedHTMLParser*."
54
+
55
+
56
+
import AdvancedHTMLParser
57
+
58
+
59
+
Most everything "public" is available through this top-level module, but some corner-case usages may require importing from a submodule. All of these associations can be found through the pydocs.
60
+
61
+
62
+
For example, to access AdvancedTag, the recommended path is just to import the top-level, and use dot-access:
63
+
64
+
import AdvancedHTMLParser
65
+
66
+
myTag = AdvancedHTMLParser.AdvancedTag('div')
67
+
68
+
69
+
However, you can also import AdvancedTag through this top-level module:
70
+
71
+
import AdvancedHTMLParser
72
+
73
+
from AdvancedHTMLParser import AdvancedTag
74
+
75
+
76
+
Or, you can import from the specific sub-module, directly:
77
+
78
+
import AdvancedHTMLParser
79
+
80
+
from AdvancedHTMLParser.Tags import AdvancedTag
81
+
82
+
83
+
All examples below are written as if "import AdvancedHTMLParser" has already been performed, and all relations in examples are based off usages from the top-level import, only.
84
+
85
+
51
86
**AdvancedHTMLParser**
52
87
53
88
Think of this like "document" in a browser.
@@ -167,7 +202,7 @@ It also exposes the various getElement\* functions which operate on the elements
167
202
168
203
For example:
169
204
170
-
205
+
171
206
# Filter off the parser all tags with "item" in class
getPeersByAttr \- Gets peers by an arbitrary attribute/value combination
239
274
240
-
getPeersWithAttrValues \- Gets peers by an arbitrary attribute/values combination.
275
+
getPeersWithAttrValues \- Gets peers by an arbitrary attribute/values combination.
241
276
242
277
getPeersByClassName \- Gets peers that contain a given class name
243
278
@@ -435,7 +470,7 @@ InvalidAttributeNameException - An attribute name was found that contained an in
435
470
IndexedAdvancedHTMLParser
436
471
=========================
437
472
438
-
IndexedAdvancedHTMLParser provides the ability to use indexing for faster search. If you are just parsing and not modifying, this is your best bet. If you are modifying the DOM tree, make sure you call IndexedAdvancedHTMLParser.reindex() before relying on them.
473
+
IndexedAdvancedHTMLParser provides the ability to use indexing for faster search. If you are just parsing and not modifying, this is your best bet. If you are modifying the DOM tree, make sure you call IndexedAdvancedHTMLParser.reindex() before relying on them.
439
474
440
475
Each of the get\* functions above takes an additional "useIndex" function, which can also be set to False to skip index. See constructor for more information, and "Performance and Indexing" section below.
0 commit comments