Skip to content

HTMLParser.get_starttag_text() returns None#3072

Merged
srittau merged 1 commit intopython:masterfrom
narusemotoki:starttag_text_none
Jun 19, 2019
Merged

HTMLParser.get_starttag_text() returns None#3072
srittau merged 1 commit intopython:masterfrom
narusemotoki:starttag_text_none

Conversation

@narusemotoki
Copy link
Contributor

Hello,

html.parser.HTMLParser().get_starttag_text() returns None when feed() isn't
called.

>>> import html.parser
>>> parser = html.parser.HTMLParser()
>>> parser.get_starttag_text() is None
True

Here is the implementation.
https://github.com/python/cpython/blob/master/Lib/html/parser.py#L119

html.parser.HTMLParser().get_starttag_text() returns None when feed() isn't
called.

```
>>> import html.parser
>>> parser = html.parser.HTMLParser()
>>> parser.get_starttag_text() is None
True
```

Here is the implementation.
https://github.com/python/cpython/blob/master/Lib/html/parser.py#L119
Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@srittau srittau merged commit aa56af7 into python:master Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants