Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Apr 28, 2018
2 parents 7d53ad3 + 0e82fd2 commit bfea28d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Beautiful Soup 爬虫/baidutieba.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_html(url):
r = requests.get(url, timeout=30)
r.raise_for_status()
# 这里我们知道百度贴吧的编码是utf-8,所以手动设置的。爬去其他的页面时建议使用:
# r.endcodding = r.apparent_endconding
# r.encoding = r.apparent_encoding
r.encoding = 'utf-8'
return r.text
except:
Expand Down

0 comments on commit bfea28d

Please sign in to comment.