摘要: HttpConnectinPool: 原因: 1.短时间内发起了高频的请求导致ip被禁 2.http连接池中的连接资源被耗尽 解决: 1.代理 2.headers中加入Conection:“close” 代理:代理服务器,可以接受请求然后将其转发。 匿名度 高匿:啥也不知道 匿名:知道你使用了代理, 阅读全文
posted @ 2021-05-09 11:22 Full-Stack~ 阅读(320) 评论(0) 推荐(0)
摘要: 直接上代码 #如何爬取图片 url = 'https://pic.qiushibaike.com/system/pictures/12223/122231866/medium/IZ3H2HQN8W52V135.jpg' img_data = requests.get(url,headers=head 阅读全文
posted @ 2021-05-09 11:13 Full-Stack~ 阅读(187) 评论(0) 推荐(0)
摘要: import requests url = 'https://movie.douban.com/j/chart/top_list' start = input('您想从第几部电影开始获取:') limit = input('您想获取多少电影数据:') dic = { 'type': '13', 'i 阅读全文
posted @ 2021-05-09 11:03 Full-Stack~ 阅读(66) 评论(0) 推荐(0)
摘要: request简单使用 #爬取搜狗首页的页面源码数据import requests#1.指定urlurl = 'https://www.sogou.com/'#2.请求发送get:get返回值是一个响应对象response = requests.get(url=url)#3.获取响应数据page_t 阅读全文
posted @ 2021-05-09 10:49 Full-Stack~ 阅读(129) 评论(0) 推荐(0)
摘要: 代码(仅限用于学习交流,未经允许不得用于商业获取非法利益): import requests from bs4 import BeautifulSoup import time import csv def get_url(start_num,end_num): url_list = [] #建立一 阅读全文
posted @ 2021-05-09 10:12 Full-Stack~ 阅读(346) 评论(0) 推荐(0)
摘要: 命名空间模式 即使不同的APP使用相同的URL名称,URL的命名空间模式也可以让你唯一反转命名的URL。 举个例子: 项目的urls.py写法: from django.conf.urls import url,include from django.contrib import admin url 阅读全文
posted @ 2021-05-09 10:07 Full-Stack~ 阅读(254) 评论(0) 推荐(0)
摘要: 话不多说,直接上代码 from django.conf import settingsfrom django.utils.module_loading import import_stringfrom django.urls import RegexURLResolver, RegexURLPatt 阅读全文
posted @ 2021-05-09 09:58 Full-Stack~ 阅读(619) 评论(1) 推荐(1)