teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

自己解決追記

2018/05/10 15:58

投稿

BITO
BITO

スコア19

answer CHANGED
@@ -15,4 +15,21 @@
15
15
  ただし、引っかかっていた文字列「»」は消えたようです。
16
16
 
17
17
  参考 - (Windows) Python3でのUnicodeEncodeErrorの原因と回避方法
18
- [https://qiita.com/butada/items/33db39ced989c2ebf644](https://qiita.com/butada/items/33db39ced989c2ebf644)
18
+ [https://qiita.com/butada/items/33db39ced989c2ebf644](https://qiita.com/butada/items/33db39ced989c2ebf644)
19
+
20
+ ### 追記
21
+
22
+ 冒頭に
23
+ ```Python
24
+ import io,sys
25
+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
26
+ sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
27
+ ```
28
+
29
+ と入れて…
30
+
31
+ ```Python
32
+ print(r.text)
33
+ ```
34
+ …とすると…
35
+ 「»」も含めて出力することに成功しました!