- 博客(17)
- 收藏
- 关注
原创 manjaro安装MySQL8
[k@k-pc ~]$ sudo pacman -S mysql[sudo] k 的密码:正在解析依赖关系...正在查找软件包冲突...软件包 (5) jemalloc-1:5.2.1-1 libmysqlclient-8.0.17-2 mysql-clients-8.0.17-2 protobuf-3.7.0-1 mysql-8.0.17-2下载大小:...
2019-10-13 18:15:47 266
原创 Manjaro 安装 mariadb 数据库
sudo pacman -S mariadbsudo chmod -R 777 /var/lib/mysql注:这个目录必须可读写,不然会报错,因为涉及到数据存储。例如sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysqlInstalling MariaDB/MySQL sy...
2019-10-11 16:07:01 472 1
原创 django学习views视图
from django.shortcuts import renderfrom django.http import HttpRequestdef about(request): assert isinstance(request, HttpRequest) return render( request, 'app/about.htm...
2019-10-07 20:19:07 166
原创 OCR百度api,python实现图像文字识别
from urllib.request import Request,urlopen# client_id 为官网获取的AK, client_secret 为官网获取的SKurl = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=【API Key】&clien...
2019-10-06 00:40:26 1624 1
原创 python使用正则
import reimport requestsfrom fake_useragent import UserAgenturl = 'https://www.baidu.com'm = re.match(r'\w+',url)print(m.group())url2 = 'http://www.97xs.org/11/11389/3303898.html'headers = {...
2019-10-05 10:35:32 235
原创 python冒泡排序
data=[16,25,39,27,12,8,45,66]foriinrange(7,-1,-1):forjinrange(i):ifdata[j]>data[j+1]:data[j],data[j+1]=data[j+1],data[j]print('次数...
2019-10-04 20:09:49 165
原创 爬虫proxy代理,简单实例
from urllib.request import Request,build_openerfrom fake_useragent import UserAgentfrom urllib.request import ProxyHandlerurl = 'https://www.qidian.com'headers = { "User-Agent":"Mozilla/5.0...
2019-10-04 19:59:30 1682
原创 python爬虫,使用cookie实例
from urllib.request import Request,build_opener,HTTPCookieProcessorfrom urllib.parse import urlencodefrom fake_useragent import UserAgentfrom http.cookiejar import MozillaCookieJardef get_cookie...
2019-10-04 19:56:45 359
原创 电脑,Windows网络命令
arp[-a [InetAddr] [-N IfaceAddr]] [-g [InetAddr] [-N IfaceAddr]] [-d InetAddr [IfaceAddr]] [-s InetAddr EtherAddr [IfaceAddr]]参数-a[ InetAddr] [ -N IfaceAddr]显示所有接口的当前 ARP 缓存表。要显示特定 IP 地址的 ARP 缓存项,...
2019-10-04 19:50:39 209
原创 git常用命令,通用
$ git config --global user.name "zvxf"$ git config --global user.email zvxf@outlook.com$ ssh-keygen -t rsa -C 'zvxf@outlook.com'$ git config --global core.editor vim$ git config --list$ git confi...
2019-10-04 19:45:48 97
原创 爬虫,使用请求头User-Agent
from urllib.request import urlopenfrom urllib.request import Requesturl = 'https://www.hao123.com'header = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like ...
2019-10-03 22:02:03 535
原创 爬虫,get请求,添加参数
arg = '编程语言'url = 'https://www.baidu.com/s?wd={}'.format(quote(arg))#url = 'https://www.baidu.com/s?wd=python'headers = { "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.3...
2019-10-03 22:00:41 679 1
原创 爬虫,post请求
from urllib.request import Request,urlopenfrom urllib.parse import urlencodeurl = 'https://www.zhihu.com/signin?next=%2F'args = { 'username':'16633970705', 'password':'16633970705'}f_dat...
2019-10-03 21:59:40 221
原创 爬虫,多个页面
from urllib.request import Request,urlopenfor i in range(3): url = 'http://hao123.zongheng.com/store/c0/w0/s0/p{0}/all.html'.format(i+1) r = Request(url) html = urlopen(r).read().decode...
2019-10-03 21:58:44 544
原创 爬虫忽略ssl证书
from urllib.request import Request,urlopenimport sslurl = 'https://www.hao123.com'r = Request(url)#忽略证书context = ssl._create_unverified_context()response = urlopen(r,context=context)print(re...
2019-10-03 21:57:42 537
原创 学习scrapy,起点小说简易爬虫
# -*- coding: utf-8 -*-import scrapyclass QidianSpider(scrapy.Spider): name = 'qidian' allowed_domains = ['qidian.com'] start_urls = ['https://read.qidian.com/chapter/ZOJ_pWRoTg9wKI0S...
2019-10-03 14:50:50 1017 2
原创 Scrapy
pip install Scrapyscrapy.cfgmyproject/ __init__.py items.py middlewares.py pipelines.py settings.py spiders/ __init__.py spider1.py spider2.py ...
2019-10-01 23:38:41 148
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人