python抠图与pip install PIL报错
窗口命令pip install PIL(python3.6+selenium——2.53.1+pycharm) from PIL import Image from selenium import webdriver
d=webdriver.Firefox()
d.get('http://www.baidu.com')
# 窗口最大化
d.maximize_window()
time.sleep(1)
# 进行全屏截图
d.get_screenshot_as_file('c:\mark666.png')
# 定位需要截图的元素位置
baidu=d.find_element('id','su')
# 获取element的顶点坐标
left=baidu.location['x']
top=baidu.location['y']
# 获取element的宽、高
elementwidth=baidu.location['x']+baidu.size['width']
elementheight=baidu.location['y']+baidu.size['height']
# 打开截图
p=Image.open('c:\mark666.png')
# 使用Image的crop函数,从截图中再次截取我们需要的区域,进行图片剪切
p=p.crop((left,top,elementwidth,elementheight))
# 保存我们需要的的图片
p.save(r'c:\mark6.png')



https://www.cnblogs.com/yuanzhoulvpi/p/9028713.html(导入pip install PIL报错参考) 可能是我进行了多次的安装和卸载,我在找着pip后输入pip install PIL报错: could not find a version that satisfies the requirement PIL no matching distribution found for PIL找着个说要下载pillow,下载进行安装报错,然后就在DOS找着pip的目录下输入pip install wheel ,把下载的Pillow‑5.1.1‑cp36‑cp36m‑win_amd64.whl
拖到C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Scripts 安装python目录的scripts文件夹里,最后在DoS窗口找着pip的目录下输入pip install PIL就成功了。 (多次进行安装卸载selenium可能出现这个问题)
python抠图与pip install PIL报错的更多相关文章
- Win10 pip install gensim 报错处理
# 故障描述 shell > pip install gensim # 报错信息如下: Command "c:\users\op\appdata\local\programs\pyth ...
- pip install mysql-python报错1. Unable to find vcvarsall.bat 2 fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory 3.error: command 'mt.exe' failed with exit statu
最近在安装mysql -python 时报错折腾了半天,通过以下方法解决: 1. pip install mysql-python报错 Unable to find vcvarsall.bat (参考 ...
- centos 7 pip install MySQL-python 报错
pip install MySQL-python 报错 pip install MySQL-python DEPRECATION: Python . Please upgrade your Pytho ...
- pip install python-igraph 报错,C core of igraph 没有安装。
(一)问题描述 Centos7 安装python-igraph时,pip install python-igraph 报错,C core of igraph 没有安装. failure: repoda ...
- Python中pip install MySQL-python报错解决方法
环境 Centos 7(其他Centos或者RHEL一样) 问题 在执行 pip install MySQL-python 时报错如: Command "python setup.py eg ...
- pip install xxxx报错(一大堆红色exception)【解决】
安装个distribute或nose或lpthw.web或virtualenv 都可能出现下面问题 root@kali:~# pip install distribute Collecting d ...
- pip install locustio报错
安装locust时, 执行pip install locustio时报错 ERROR: Cannot uninstall 'requests'. It is a distutils installed ...
- python安装matplotlib:python -m pip install matplotlib报错
matplotlib是python中强大的画图模块. 首先确保已经安装python,然后用pip来安装matplotlib模块. 进入到cmd窗口下,建议执行python -m pip install ...
- python pip install mysql-python报错
报错: 下载地址: https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
随机推荐
- settimeout、setinterval区别和相互模拟
前几天翻书,看到“避免双重求值”一节时有提到settimeout().setinterval() 建议传入函数而不是字符串以作为第一个参数,所以这里总结一下settimeout()和setinterv ...
- 带你从零学ReactNative开发跨平台App开发(四)
ReactNative跨平台开发系列教程: 带你从零学ReactNative开发跨平台App开发(一) 带你从零学ReactNative开发跨平台App开发(二) 带你从零学ReactNative开发 ...
- LeetCode题解之Number of 1 Bits
1.题目描述 2.问题分析 使用C++ 标准库的 bitset 类,将整数转换为 二进制,然后将二进制表示转换为字符串,统计字符串中 1 的个数即可. 3.代码 int hammingWeight(u ...
- 4.Servlet过滤器
1.Servlet 编写过滤器 Servlet 过滤器是可用于 Servlet 编程的 Java 类,有以下目的: 在客户端的请求访问后端资源之前,拦截这些请求. 在服务器的响应发送回客户端之前,处理 ...
- 树莓派2 raspyberry Pi2 交叉编译app
Pi 使用的是ARMV7架构的BCM2836, 下载交叉编译器 arm-linux-gnueabihf-gcc 即可. 本地环境: Ubuntu14 + x86_64 1. 下载编译器地址: 1). ...
- 在 Azure VM 上安装 LEMP Web 服务器
本文逐步讲解如何在 Azure 中的 Ubuntu VM 上部署 NGINX Web 服务器.MySQL 和 PHP(LEMP 堆栈). LEMP 堆栈可以替代常用的 LAMP 堆栈,可安装在 Azu ...
- Oracle EBS 获取公司段的本位币
SELECT gls.currency_code FROM hr_organization_information_v t, gl_sets_of_books gls WHERE t.org_info ...
- Oracle EBS 请求
SELECT t.responsibility_id, t.responsibility_key, t.responsibility_name, t.description, t.menu_id, f ...
- 《SQL Server 2008从入门到精通》--20180704
XML查询技术 XML文档以一个纯文本的形式存在,主要用于数据存储.不但方便用户读取和使用,而且使修改和维护变得更容易. XML数据类型 XML是SQL Server中内置的数据类型,可用于SQL语句 ...
- [WINDOWS MOBILE | SOLUTION] 通过有线连接到 PC 后,WM设备能 PING 通网关但是不能上网
在 Windows Mobile Device Center 处点击 Mobile Device Settings, Connection Settings, 选择 This computer con ...