首页   注册   登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  wsds  ›  全部回复第 1 页 / 共 11 页
回复总数  210
1  2  3  4  5  6  7  8  9  10 ... 11  
厉害了,这应该很简单的啊
@lniwn 网页支持吗
@zsdroid 我就是这种操作,仍不行啊
下载验证码到本地并获取 cookies
r = requests.get("获取验证码连接")
urllib.request.urlretrieve(r.url, "./a.jpg")
self.cookies = dict(r.cookies)
==========================
查询时,添加下载验证码的 cookies
r = requests.Session().post("查询链接",data=self.data, cookies=self.cookies)
print(self.data)
r.encoding = "utf-8"
print(r.text)
搞不定球,日了狗🐶
@bk201
@Junwwwww
那怎么同步这个验证码呢
requests.Session().get("http://www.cszjw.net/newCaptcha")获取的验证码,始终与 example link 不同步,不知道为什么
@wanganjun 额,确实是个办法,这玩意儿,是没关闭这提示的入口 吗
@maninnet 求批处理代码
@Keyes 没用,重置了几回了都
@ysc3839 为了一个 python 我重装系统,这成本有点高
直接了编译安装的
@chenqh 装不了,一样报错
root:~# sudo apt-get install python3-pip
sudo: unable to resolve host mycloud
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (8.1.1-2ubuntu0.4).
0 upgraded, 0 newly installed, 0 to remove and 175 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
@chenqh
root:~# python -m pip install -U pip
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/basecommand.py", line 228, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/install.py", line 241, in run
with self._build_session(options) as session:
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/basecommand.py", line 81, in _build_session
insecure_hosts=options.trusted_hosts,
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 338, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 101, in user_agent
zip(["name", "version", "id"], distro.linux_distribution()),
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 120, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 634, in linux_distribution
self.version(),
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 688, in version
self.lsb_release_attr('release'),
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 836, in lsb_release_attr
return self._lsb_release_info.get(attribute, '')
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 522, in __get__
ret = obj.__dict__[self._fname] = self._f(obj)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 933, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File "/usr/lib/python2.7/subprocess.py", line 574, in check_output
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/pip/__main__.py", line 19, in <module>
sys.exit(_main())
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/__init__.py", line 246, in main
return command.main(cmd_args)
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/basecommand.py", line 264, in main
timeout=min(5, options.timeout)) as session:
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/basecommand.py", line 81, in _build_session
insecure_hosts=options.trusted_hosts,
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 338, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 101, in user_agent
zip(["name", "version", "id"], distro.linux_distribution()),
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 120, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 634, in linux_distribution
self.version(),
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 688, in version
self.lsb_release_attr('release'),
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 836, in lsb_release_attr
return self._lsb_release_info.get(attribute, '')
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 522, in __get__
ret = obj.__dict__[self._fname] = self._f(obj)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 933, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File "/usr/lib/python2.7/subprocess.py", line 574, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1
@kethylar 那应该没啥压力,哈哈
@kethylar 小文件指的是多小?
@kethylar 知道了,把 len 去掉就显示了,多谢
@kethylar 这个太牛逼了,能不能把这个错误的值也显示出来啊
@imn1 不是同行,是要交叉,可能 我举的例子看上去每一行都一样,其实不是这样的,是乱序的
1  2  3  4  5  6  7  8  9  10 ... 11  
关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   3086 人在线   最高记录 3762   ·  
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.1 · 16ms · UTC 01:22 · PVG 09:22 · LAX 18:22 · JFK 21:22
♥ Do have faith in what you're doing.
沪ICP备16043287号-1