摘要:
2. Numpy NumPy(Numerical Python) 是 Python 语言的一个扩展程序库,支持大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库。 2.1 创建ndarray 使用np.array()创建 import numpy as np # 一维 arr = np 阅读全文
posted @ 2021-05-09 22:30
Full-Stack~
阅读(306)
评论(0)
推荐(0)
摘要:
IPython有一些特殊的命令。能够方便轻松地控制IPython系统。 魔术命令以百分号%为前缀;可看作运行于IPython系统中的命令行程序,它们大都还有一些参数选项。在命令后面加问号(?)可以查看。默认可以不带百分号使用的,只要没有定义与其同名的变量即可。可以通过%automagic命令打开或者 阅读全文
posted @ 2021-05-09 20:54
Full-Stack~
阅读(500)
评论(0)
推荐(0)
摘要:
直接上代码吧 中间件简单使用: # -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # https://docs.scrapy.org/en/lat 阅读全文
posted @ 2021-05-09 12:16
Full-Stack~
阅读(194)
评论(0)
推荐(0)
摘要:
Scrapy框架的使用 - pySpider- 什么是框架? - 就是一个具有很强通用性且集成了很多功能的项目模板(可以被应用在各种需求中)- scrapy集成好的功能: - 高性能的数据解析操作(xpath) - 高性能的数据下载 - 高性能的持久化存储 - 中间件 - 全栈数据爬取操作 - 分布 阅读全文
posted @ 2021-05-09 11:45
Full-Stack~
阅读(181)
评论(0)
推荐(0)
摘要:
selenium基本操作(需要提前下载浏览器driver.exe) from selenium import webdriver from time import sleep bro = webdriver.Chrome(executable_path='chromedriver.exe') bro 阅读全文
posted @ 2021-05-09 11:38
Full-Stack~
阅读(85)
评论(0)
推荐(0)
摘要:
基于Flask的示例 Server端 from flask import Flask,render_template import time app = Flask(__name__) @app.route('/bobo') def index_bobo(): time.sleep(2) retur 阅读全文
posted @ 2021-05-09 11:26
Full-Stack~
阅读(92)
评论(0)
推荐(0)
摘要:
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~
阅读(186)
评论(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~
阅读(63)
评论(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~
阅读(124)
评论(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~
阅读(345)
评论(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~
阅读(251)
评论(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~
阅读(617)
评论(1)
推荐(1)

浙公网安备 33010602011771号