FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
html5lib-python/utils/extract-entities.py at python3-old · feitianyiren/html5lib-python · GitHub
feitianyiren
/
html5lib-python
Public
forked from
html5lib/html5lib-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
html5lib-python
/
utils
/
extract-entities.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
13 lines (13 loc) · 544 Bytes
Breadcrumbs
html5lib-python
/
utils
/
extract-entities.py
Copy path
File metadata and controls
13 lines (13 loc) · 544 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
import
urllib2
entitiesPage
=
"http://www.whatwg.org/specs/web-apps/current-work/multipage/section-entities.html"
output
=
""
for
line
in
urllib2
.
urlopen
(
entitiesPage
).
readlines
():
entityNameSig
=
" <td> <code title=
\"
\"
>"
entityValueSig
=
" </td><td> "
if
line
.
startswith
(
entityNameSig
):
x
=
len
(
entityNameSig
)
output
+=
"
\"
"
+
line
[
x
:
-
8
]
+
"
\"
: "
elif
line
.
startswith
(
entityValueSig
):
x
=
len
(
entityValueSig
)
output
+=
"u
\"
"
+
line
[
x
:
-
1
].
replace
(
"U+"
,
"
\\
u"
)
+
"
\"
,
\n
"
print
output
Back
|
FazBrowse Home
|
New Git URL