
python
shuidefu
xxx
展开
-
selenium python怎么禁用显示 "DevTools on ws..."
selenium python怎么禁用显示 “DevTools on ws…”chrome v70, chromedriver v2.42Solution:from selenium import webdriveroptions.add_experimental_option(‘excludeSwitches’, [‘enable-logging’])driver = webdrive...原创 2020-04-14 13:28:46 · 9169 阅读 · 2 评论 -
options.add_argument(r'--user-data-dir=C:\Users\name\AppData\Local\Google\Chrome\User Data') 绕过登录
chrome配置转自: https://www.jianshu.com/p/5669fa439c2b–ignore-certificate-errors–allow-running-insecure-content启动参数:–User-data-dir=“UserData”设置用户目录;–disk-cache-dir="%Temp%\Chrome"设置缓存目录;–enable-e...原创 2019-08-14 18:23:03 · 12133 阅读 · 1 评论 -
Python安装完成 运行的时候报错 0xc000007b解决办法 亲测下载
python3.6 安装完成后报运行错误,0xc000007b,网上搜索了一大堆说缺少VC运行环境,但是下载下来VC环境安装又报错误,弄了半天终于弄出来了。我把缺少的所有dll都打包成一个压缩包,供大家使用,使用说明,把本压缩吧下载下来,放到C:\Windows\SysWOW64下面即可,或者在安装的Python根目录下面新建一个dll目录,比如:d:\ide\python\dll,把下载下来...转载 2019-05-12 20:22:51 · 1971 阅读 · 0 评论 -
使用selenium+chrome能抓取数据,而selenium+phantomjs抓取数据为空?
使用selenium+chrome能抓取数据,而selenium+phantomjs抓取数据为空?[图片] 爬虫采用 使用selenium+chrome能抓取数据,而selenium+phantomjs抓取数据为空,不知道原因出在哪儿,求助各位。 [图片]…关注者7被浏览1,9184 个回答六六六六六六昼短苦夜长,何不秉烛游遇到同样的问题,Chrome 可以正常返回数据,Pha...转载 2019-04-26 13:40:08 · 1017 阅读 · 0 评论 -
windows下open函数'gbk' codec can't decode byte
windows下open函数’gbk’ codec can’t decode bytelyglyg这是由于在Windows下Python使用open()函数打开文件时会默认使用gbk解码,即使文件本身存储为UTF-8格式。将:Pythonwith open(‘temp.txt’, ‘r’) as f:改为:Pythonwith open(‘temp.txt’,‘r’,encodi...转载 2019-04-13 22:07:52 · 11661 阅读 · 0 评论 -
python使用urlretrieve下载文件时出现403 forbidden的解决方法(反爬虫)
python使用urlretrieve下载文件时出现403 forbidden的解决方法出现该错误的原因是服务器开启了反爬虫,一般情况下只需要设置header模拟浏览器即可,但是urlretrieve并未提供header参数。使用urlopen也可以直接下载文件,例headers = {“User-Agent”: “Mozilla/5.0 (Windows NT 6.3; Win64; x6...转载 2019-03-31 16:57:11 · 4602 阅读 · 1 评论 -
正则表达式匹配 href
正则表达式匹配:所有的超链接的href和链接文字转https://blog.youkuaiyun.com/qq_15283475/article/details/73648996<a.+?href=\"(.+?)\".*>(.+)</a>单独href : <a.+?href=\"(.+?)\".*>单独连接文字:>(.+)</a>...转载 2018-11-16 13:46:48 · 1872 阅读 · 0 评论 -
关于使用flask db 提示no modules named 'db'解决方案
原文提示安装sudo pip3 install flask-migrate实际安装后仍然报错实际解决方案:sudo pip install flask-migrate(不是pip3)如果你尝试多种其他方案仍有以上报错,请尝试此方案。...原创 2018-10-29 22:30:53 · 2084 阅读 · 0 评论