摘要:
语法和jquey几乎一致 安装 conda install pyquery 一、初始化 标准用法 from pyquery import PyQuery as pq import requests # r = requests.get(url='http://www.baidu.com') html 阅读全文
摘要:
一、urllib.urlopen 1、urlopen from urllib import request r = request.urlopen('http://www.baidu.com/') # 获取状态码 print(r.status) # 获取相应头 print(r.getheaders( 阅读全文
摘要:
join用的不错 a = "Hello, world" b = "你好,世界" c = "How are you?" with open(file='a.txt', mode='w', encoding='utf-8') as f: f.write('\n'.join([a, b, c])) f.w 阅读全文
摘要:
csv 逗号分隔值 一、写入 1、列表 单行添加 import csv # with open(file='a.csv', mode='w', encoding='utf-8', newline='') as f: write = csv.writer(f) write.writerow(['id' 阅读全文
摘要:
官网:https://github.com/scrapy-plugins/scrapy-splash 1、安装: pip install scrapy-splash 2、运行splash docker run -p 8050:8050 scrapinghub/splash 3、配置setting文件 阅读全文
摘要:
1、urlparse 作用:解析url from urllib import parse url = "https://book.qidian.com/info/1004608738" result = parse.urlparse(url=url) print(result) 结果: ParseR 阅读全文
摘要:
官网: https://splash.readthedocs.io/en/stable/index.html 常用接口(API) 1、render.html 格式: http://10.63.32.49:8050/render.html?url=https://www.baidu.com&wait= 阅读全文
摘要:
jd->iphone import requests from lxml import etree # search_key = 'iphone' jd_url = "https://search.jd.com/Search?keyword={}&enc=utf-8&wq={}&pvid=1a54a 阅读全文
摘要:
官网:https://splash.readthedocs.io/en/stable/ 1、安装Docker https://www.cnblogs.com/wt7018/p/11880666.html 2、pull the image sudo docker pull scrapinghub/sp 阅读全文
摘要:
参考 https://www.runoob.com/docker/ubuntu-docker-install.html 1.卸载 sudo apt-get remove docker docker-engine docker.io containerd runc 2.安装Docker sudo ap 阅读全文