We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4392cf1 commit 8ea3b1bCopy full SHA for 8ea3b1b
selectolax/lexbor.pyx
@@ -204,7 +204,8 @@ cdef class LexborHTMLParser:
204
str
205
A string showing the number of characters in the parsed HTML.
206
"""
207
- return f"<LexborHTMLParser chars='{len(self.root.html)}'>"
+ html_len = len(self.root.html if self.root is not None else "")
208
+ return f"<LexborHTMLParser chars='{html_len}'>"
209
210
@property
211
def selector(self):
0 commit comments