import requests
from bs4 import BeautifulSoupall_url = 'http://www.7160.com/qingchunmeinv/'

# 请求头
header = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 UBrowser/6.1.2107.204 Safari/537.36'
}

start_html = requests.get(all_url,headers = header)
html = start_html.text.encode('iso-8859-1').decode('gbk')  # 将gb2312转为UTF-8格式
print(html)

 

相关文章:

  • 2022-01-10
  • 2021-11-15
  • 2022-01-10
  • 2021-10-30
  • 2022-12-23
  • 2021-05-28
  • 2022-02-19
猜你喜欢
  • 2021-12-25
  • 2022-12-23
  • 2021-11-12
  • 2021-12-31
  • 2022-12-23
  • 2021-12-25
相关资源
相似解决方案