HTMLに特殊文字(<や>)を書くときは、エスケープ処理しなさいって教わらなかったの???
&lt; &gt;にしてくれえええ

Follow

@m10i
parseする前に正規表現で置換するとかするしか…
('、3)_ヽ)_

· · Web · 1 · 0 · 0

@hinotsuki それしかないですね

結果こうなった !
Python3+Scrapy+regex
---------------------------------
# エスケープされてない箇所を修正
html = response.body.decode('utf-8')
html = regex.sub(r'<([\P{Ascii}]+)>', r'&lt;\1&gt;', html)
response = response.replace(body=html)
---------------------------------

Sign in to participate in the conversation
RO丼 - RO Mastodon

ラグナロクオンラインユーザ向けのMastodonインスタンス。