【爬虫】 爬虫请求json数据,返回乱码问题的解决

前端之家收集整理的这篇文章主要介绍了【爬虫】 爬虫请求json数据,返回乱码问题的解决前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
from django.http import JsonResponse
from rest_framework.utils  json

from utils  requests_pro
# from rest_framework.views import  APIView
from lxml  etree
 orm
orm.orm_standby()
from dal  models

 class WeekRequests(APIView):
#     def get(self,request):         message = {}         try:

sessions =requests_pro.session_requests_b()

url="https://movie.douban.com/j/search_subjects?type=movie&tag=%E7%83%AD%E9%97%A8&sort=recommend&page_limit=20&page_start=0"

ret = sessions.get(url=url)

ret.encoding="utf-8"
ret_text =ret.text
print(ret_text)

 

猜你在找的Python相关文章