我用Selenium抓了一些句子,然后将结果打印到.txt文件中,但是它无法显示'
,而是显示一些奇怪的字符:
原文:
I don't think so.
.txt文件中的
I don? think so.
我已经将.txt编码指定为“ utf-8”,该怎么办?
答案 0 :(得分:1)
您需要为此打开文件以“ utf-8”编写
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="b">
<h1>Hello</h1>
<div class="a">
<p class="ABC">A..........Z</p> //this could be present in some pages
</div>
</div>
希望对您有帮助!