0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Python】BeautifulSoupで取得した文字列が文字化けしている

Last updated at Posted at 2025-10-27

概要

  • BeautifulSoupでスクレイピングしたtextが文字化けする場合がある

出力例

草叢BOOKS 各務原店   

対応策

  • デコード周りの問題だと思われるので、UTF-8などの文字コード変換を試す。
response = requests.get(url, headers=headers, timeout=10) 
response.encoding = 'utf-8'
  • 調べると、responseを指定するところでencodingをUTF-8に設定することが出来るとのこと。

解決

草叢BOOKS 各務原店  
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?