We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8861dbe + b15d344 commit 069b7b3Copy full SHA for 069b7b3
2 files changed
microdata.py
@@ -209,7 +209,7 @@ def _text(e):
209
chunks = []
210
if e.nodeType == e.TEXT_NODE:
211
chunks.append(e.data)
212
- elif e.tagName == 'script':
+ elif hasattr(e, 'tagName') and e.tagName == 'script':
213
return ''
214
for child in e.childNodes:
215
chunks.append(_text(child))
test-data/example.html
@@ -15,6 +15,7 @@
15
<span itemprop="streetAddress">
16
20341 Whitworth Institute
17
405 N. Whitworth
18
+ <!-- Comment Node -->
19
<script>
20
// Unrelated text
21
</script>
0 commit comments