07 2021 档案
摘要:先写一些前言吧,自己感觉python已经有一定的基础了,但是在安装这个过程居然用了一下午,感觉有些收货,特地写下来与大家分享一下。 PySpider是一个强大的网络爬虫系统,GitHub地址:https://github.com/binux/pyspider;官方文档地址:http://docs.p
阅读全文
摘要:1 介绍 Selenium是浏览器的自动化测试工具,使用它可以控制浏览器各种点击等操作。 2 环境搭建 先安装Chrome等浏览器,然后安装对应版本的ChromeDriver驱动程序,然后pip安装Selenium 2 代码示例 看完,这个程序,你就掌握Selenium的基本用法 from sele
阅读全文
摘要:import json import re import requests from requests.exceptions import RequestException import time # 获取html def get_one_page(url): try: headers={ 'Use
阅读全文
摘要:3 基本库的使用 1)使用 urllib 是python内置的HTTP请求库,包含request、error、parse、robotparser urlopen() urllib.request.urlopen(url, data=None, [timeout, ]*, cafile=None, c
阅读全文
摘要:1 环境搭建及创建 1) 安装Django 方法一:pip install django 方法二:Pycharm File——settings——Project——Python Interpreter——Python3.9 添加Django安装,设置django的环境变量 3)创建Django项目
阅读全文
摘要:安装Matplotlib 库 python -m pip install matplotlib 绘制简单折线图 importmatplotlib.pyplotasplt #导入matplotlib的pyplot squares=[1,4,9,16,25] fig,ax=plt.subplots()#
阅读全文
摘要:0 配置pip 包库映像地址【以清华为例】 文件路径及文件名:C/user/Username/pip/pip.ini 文件内容: 1 字符串相关函数 .title() # 将字符串每个单词的首字母大写 .upper() #不改变字符串变量的值 .lower() #不改变字符串变量的值 f"{var}
阅读全文