上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
摘要: #效果不是很好 加上灰度处理和二值化处理 就变好了 import pytesseract from PIL import Image from PIL import ImageEnhance #打开图片 img = Image.open('f7vf.png') #提高辨识度 img = img.co 阅读全文
posted @ 2020-01-12 17:00 求知鱼 阅读(375) 评论(0) 推荐(0) 编辑
摘要: from selenium import webdriver import time from selenium.webdriver.chrome.options import Options #创建一个参数对象,用来控制Chrome以无界面模式打开 chrome_options = Options 阅读全文
posted @ 2020-01-12 16:58 求知鱼 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 1、Headless Chrome 谷歌无界面版本 from selenium.webdriver.chrome.options import Options chrome_options = Options() chrome_options.add_argument('--headless') c 阅读全文
posted @ 2020-01-12 16:56 求知鱼 阅读(214) 评论(0) 推荐(0) 编辑
摘要: #爬取网站 m.8684.cn/bus_switch 公交线路 郑州 import requests import time from lxml import etree #列表保存所有线路信息 items = [] #添加头部 作为全局 headers = { 'User-Agent': 'Moz 阅读全文
posted @ 2020-01-12 16:54 求知鱼 阅读(1523) 评论(1) 推荐(0) 编辑
摘要: 需要下载每种浏览器的驱动程序 并且记录该驱动存放路径 PhantomJS: #PhantomJS已经不被selenium支持 但是现在好像还能用 使用的话 需要降低selenium版本 #或者使用无窗口化的火狐谷歌驱动 from selenium import webdriver import ti 阅读全文
posted @ 2020-01-12 16:35 求知鱼 阅读(456) 评论(0) 推荐(0) 编辑
摘要: json数据:book.json { "store": { "book": [ { "category": "文学", "author": "路遥", "title": "平凡的世界", "price": 8.95 }, { "category": "文学", "author": "席慕蓉", "t 阅读全文
posted @ 2020-01-12 16:26 求知鱼 阅读(4513) 评论(0) 推荐(0) 编辑
摘要: 0、换行问题 存储的时候显示的\n是有效的 也就是写成HTML文档时在编辑器里打开是一行 在读取过来单独使用的时候换行符生效 浏览器里打开HTML就会分行 1、图片 爬取网站图片http://sc.chinaz.com/tupian/xingganmeinvtupian_3.html 懒加载:用到的 阅读全文
posted @ 2020-01-12 16:16 求知鱼 阅读(248) 评论(0) 推荐(0) 编辑
摘要: #糗事百科挂了 #照视频手打 import urllib.request import urllib.parse import re import os import time #下载每一页回传内容中的图片 #使用正则搜索图片链接 def down_load_image(content): patt 阅读全文
posted @ 2020-01-12 16:10 求知鱼 阅读(629) 评论(0) 推荐(0) 编辑
摘要: # 简单使用: # 说明:选择器 jquery #导入from bs4 import BeautifulSoup #使用方式:可以将一个html文档,转化为一个对象, # 然后通过对象的方法或者属性去查找指定对象 #转化本地文件soup = BeautifulSoup(open("本地文件"),'l 阅读全文
posted @ 2020-01-12 16:09 求知鱼 阅读(1248) 评论(0) 推荐(0) 编辑
摘要: 正则表达式解析(用来匹配一类具有相同规则的字符串) 单字符: . :除换行外所有字符 []:[abc]匹配集合中任意一个字符 \d:数字[0-9] \D:非数字 \w:数字、字母、下划线、中文 \W:非\w \s:所有空白字符 \S:非空白 数量描述: *:任意多次 》=0 +:至少一次 》=1 ? 阅读全文
posted @ 2020-01-12 16:08 求知鱼 阅读(197) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页