05 2019 档案

摘要:一、介绍及安装 selenium最初是一个自动化测试工具,而爬虫中使用它主要是为了解决requests无法直接执行JavaScript代码的问题 selenium本质是通过驱动浏览器,完全模拟浏览器的操作,比如跳转、输入、点击、下拉等,来拿到网页渲染之后的结果,可支持多种浏览器 from selen 阅读全文
posted @ 2019-05-31 08:33 pdun 阅读(265) 评论(0) 推荐(0)
摘要:requests简介 基于get请求 import requests # https://www.baidu.com/s?wd=python url='https://www.baidu.com/s' kw=input(">>:") headers={ 'User-Agent': 'Mozilla/ 阅读全文
posted @ 2019-05-29 18:43 pdun 阅读(145) 评论(0) 推荐(0)
摘要:redis简介 Redis keys命令 1 DEL key 该命令用于在 key 存在时删除 key。 2 DUMP key 序列化给定 key ,并返回被序列化的值。 3 EXISTS key 检查给定 key 是否存在。 4 EXPIRE key seconds 为给定 key 设置过期时间, 阅读全文
posted @ 2019-05-28 20:44 pdun 阅读(223) 评论(0) 推荐(0)
摘要:爬虫在使用场景中的分类 robots.txt协议 君子协议 User-agent: Baiduspider Allow: /article Allow: /oshtml Allow: /ershou Allow: /$ Disallow: /product/ Disallow: / User-Age 阅读全文
posted @ 2019-05-27 17:33 pdun 阅读(281) 评论(0) 推荐(0)
摘要:一、vue环境配置及基本使用 vue环境搭建 #1) 安装node 官网下载安装包,傻瓜式安装:https://nodejs.org/zh-cn/ #2) 安装cnpm npm install -g cnpm --registry=https://registry.npm.taobao.org #3 阅读全文
posted @ 2019-05-22 22:24 pdun 阅读(208) 评论(0) 推荐(0)
摘要:一、自己用for循环处理(太麻烦) 二、用django提供的序列化组件 三、rest-framework序列化之Serializer from django.db import models # Create your models here. class Book(models.Model): t 阅读全文
posted @ 2019-05-17 08:02 pdun 阅读(200) 评论(0) 推荐(0)
摘要:前言 一、什么是drf # class Student(): # name='pdun' # # def __init__(self,age): # self.age=age # # s1=Student(1) # print(s1.name) # print(s1.age) # print(s1. 阅读全文
posted @ 2019-05-15 22:54 pdun 阅读(149) 评论(0) 推荐(0)
摘要:一、CBV与FBV 二、CBV的用法及源码分析 1、用法 #视图层 # 1 先导入View(继承它) from django.views import View # 写一个类继承它, class Test(View): #request必须传,后面的可传可不传(有可能有名,无名分组) def get 阅读全文
posted @ 2019-05-15 21:45 pdun 阅读(556) 评论(0) 推荐(0)
摘要:RESTful规范 10条规范 总结 django下resful接口规范的编写 class Books(View): # 获取所有图书 def get(self, request): print(type(request)) response = {'status': 100, 'data': No 阅读全文
posted @ 2019-05-15 19:09 pdun 阅读(187) 评论(0) 推荐(0)
摘要:一、Vue了解 简单使用 二、Vue实例 1、el:实例 2、data:数据 3、实例的methods <!DOCTYPE html> <html lang="en"> <head> <style> .btn{ width:200px; height:300px; background: red; 阅读全文
posted @ 2019-05-13 10:16 pdun 阅读(192) 评论(0) 推荐(0)
摘要:喜欢请打赏 支付宝 微信 扫描二维码打赏 支付宝打赏 了解更多 喜欢请打赏 支付宝 微信 扫描二维码打赏 支付宝打赏 了解更多 喜欢请打赏 支付宝 微信 扫描二维码打赏 支付宝打赏 支付宝 微信 支付宝 微信 扫描二维码打赏 支付宝打赏 扫描二维码打赏 支付宝打赏 扫描二维码打赏 支付宝打赏 了解更 阅读全文
posted @ 2019-05-09 16:45 pdun 阅读(174) 评论(0) 推荐(0)
摘要:阅读目录 一 isinstance(obj,cls)和issubclass(sub,super) 二 反射 三 __setattr__,__delattr__,__getattr__ 四 二次加工标准类型(包装) 五 __getattribute__ 六 描述符(__get__,__set__,__ 阅读全文
posted @ 2019-05-09 09:24 pdun 阅读(187) 评论(0) 推荐(0)
摘要:数据的读写不一定都是文件,也可能在内存中读写 StringIO(内存中读写str) 要把str写入StringIO,先创建一个StringIO,然后,像文件一样写入即可 要读取StringIO,可以用str初始化StringIO.然后,像读文件一样 BytesIO(内存中读写二进制数据) 先创建By 阅读全文
posted @ 2019-05-07 14:51 pdun 阅读(256) 评论(0) 推荐(0)
摘要:首先考虑是么数据库,如果不想使用默认数据库,使用MySQL的话, #setings DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME':'bbs', 'HOST':'127.0.0.1', 'PORT':33 阅读全文
posted @ 2019-05-07 12:09 pdun 阅读(134) 评论(0) 推荐(0)