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

from django.http import JsonResponse
from rest_framework.utils import json

from utils import requests_pro
# from rest_framework.views import  APIView
from lxml import etree
from utils import orm
orm.orm_standby()
from dal import 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)

 

上一篇:Java原理探索:AQS的技术体系之CLH、MCS锁的原理及实现


下一篇:Golang并发操作RabbitMQ