selectolax 0.3.24__cp39-cp39-macosx_10_9_universal2.whl → 0.3.25__cp39-cp39-macosx_10_9_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of selectolax might be problematic. Click here for more details.
- selectolax/__init__.py +1 -1
- selectolax/lexbor/util.pxi +19 -0
- selectolax/lexbor.c +21520 -16146
- selectolax/lexbor.cpython-39-darwin.so +0 -0
- selectolax/lexbor.pyi +19 -0
- selectolax/lexbor.pyx +1 -0
- selectolax/modest/util.pxi +19 -0
- selectolax/parser.c +6727 -1349
- selectolax/parser.cpython-39-darwin.so +0 -0
- selectolax/parser.pyi +21 -0
- selectolax/parser.pyx +1 -0
- selectolax/utils.pxi +94 -0
- {selectolax-0.3.24.dist-info → selectolax-0.3.25.dist-info}/METADATA +7 -2
- selectolax-0.3.25.dist-info/RECORD +26 -0
- {selectolax-0.3.24.dist-info → selectolax-0.3.25.dist-info}/WHEEL +1 -1
- selectolax-0.3.24.dist-info/RECORD +0 -24
- {selectolax-0.3.24.dist-info → selectolax-0.3.25.dist-info}/LICENSE +0 -0
- {selectolax-0.3.24.dist-info → selectolax-0.3.25.dist-info}/top_level.txt +0 -0
|
Binary file
|
selectolax/lexbor.pyi
CHANGED
|
@@ -37,6 +37,7 @@ class LexborCSSSelector:
|
|
|
37
37
|
def any_matches(self, query: str, node: "LexborNode") -> bool: ...
|
|
38
38
|
|
|
39
39
|
class LexborNode:
|
|
40
|
+
parser: "LexborHTMLParser"
|
|
40
41
|
@property
|
|
41
42
|
def mem_id(self) -> int: ...
|
|
42
43
|
@property
|
|
@@ -83,6 +84,7 @@ class LexborNode:
|
|
|
83
84
|
def replace_with(self, value: bytes | str | "LexborNode") -> None: ...
|
|
84
85
|
def insert_before(self, value: bytes | str | "LexborNode") -> None: ...
|
|
85
86
|
def insert_after(self, value: bytes | str | "LexborNode") -> None: ...
|
|
87
|
+
def insert_child(self, value: bytes | str | "LexborNode") -> None: ...
|
|
86
88
|
@property
|
|
87
89
|
def raw_value(self) -> NoReturn: ...
|
|
88
90
|
def scripts_contain(self, query: str) -> bool: ...
|
|
@@ -120,3 +122,20 @@ class LexborHTMLParser:
|
|
|
120
122
|
def css_matches(self, selector: str) -> bool: ...
|
|
121
123
|
def clone(self) -> "LexborHTMLParser": ...
|
|
122
124
|
def unwrap_tags(self, tags: list[str]) -> None: ...
|
|
125
|
+
|
|
126
|
+
def create_tag(tag: str) -> "LexborNode":
|
|
127
|
+
"""
|
|
128
|
+
Given an HTML tag name, e.g. `"div"`, create a single empty node for that tag,
|
|
129
|
+
e.g. `"<div></div>"`.
|
|
130
|
+
"""
|
|
131
|
+
...
|
|
132
|
+
|
|
133
|
+
def parse_fragment(html: str) -> list["LexborNode"]:
|
|
134
|
+
"""
|
|
135
|
+
Given HTML, parse it into a list of Nodes, such that the nodes
|
|
136
|
+
correspond to the given HTML.
|
|
137
|
+
|
|
138
|
+
For contrast, HTMLParser adds `<html>`, `<head>`, and `<body>` tags
|
|
139
|
+
if they are missing. This function does not add these tags.
|
|
140
|
+
"""
|
|
141
|
+
...
|
selectolax/lexbor.pyx
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
include "../utils.pxi"
|
|
2
|
+
|
|
3
|
+
def create_tag(tag: str):
|
|
4
|
+
"""
|
|
5
|
+
Given an HTML tag name, e.g. `"div"`, create a single empty node for that tag,
|
|
6
|
+
e.g. `"<div></div>"`.
|
|
7
|
+
"""
|
|
8
|
+
return do_create_tag(tag, HTMLParser)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def parse_fragment(html: str):
|
|
12
|
+
"""
|
|
13
|
+
Given HTML, parse it into a list of Nodes, such that the nodes
|
|
14
|
+
correspond to the given HTML.
|
|
15
|
+
|
|
16
|
+
For contrast, HTMLParser adds `<html>`, `<head>`, and `<body>` tags
|
|
17
|
+
if they are missing. This function does not add these tags.
|
|
18
|
+
"""
|
|
19
|
+
return do_parse_fragment(html, HTMLParser)
|