【发布时间】:2021-03-19 00:00:44
【问题描述】:
我正在使用它在 div 标签之间添加 html,但它显示 Unexpected token '<'
browser.execute_script("arguments[0].innerHTML = " + f'{x["solution"]}', solution)
x["solution"] 是一个 json 文件,其中包含像 <strong> bold </strong> 这样的 html 等。
【问题讨论】:
-
<strong> bold <\strong>不应该是<strong> bold </strong>??? -
我最近遇到了类似的问题。我不得不使用符号代码和 unescape()。
-
@WasifHasan 是的,先生,我有时会对斜线感到困惑:P
标签: javascript python json selenium automation