requests.exceptions.MissingSchema: Invalid URL '//p9.pstatp.com/list/pgc-image/1538380201743a84869e0b6': No schema supplied. Perhaps you meant http:////p9.pstatp.com/list/pgc-image/1538380201743a84869e0b6?

碰到这个问题的地方来源:爬取今日头条图片

报错写法:

response = requests.get(item.get("image"))

并且注意报错的地方,说我们搜索的可能是http:////p9.pstatp.com/list/pgc-image/1538380201743a84869e0b6?,但这样去搜索栏里是搜索不到内容的

正确写法:

response = requests.get("http:" + item.get("image"))

因此在在将请求头的时候要注意一点。

requests.exceptions.MissingSchema的更多相关文章

  1. requests.exceptions.MissingSchema: Invalid URL 'xxxxxxxxxxxxx': No schema supplied. Perhaps you meant xxxxxxxxxxxxx

    import requests session = requests.session() carProposalUrl = "www.caaaa.com.cn/aaaa/aaaaa/carP ...

  2. requests 处理异常错误 requests.exceptions.ConnectionError HTTPSConnectionPool [Errno 10060]

    使用python requests模块调用vmallarg.vmall.com接口API时报如下错误: requests.exceptions.ConnectionError: HTTPSConnec ...

  3. 关于requests.exceptions.SSLError: HTTPSConnectionPool

    问题: requests.exceptions.SSLError: HTTPSConnectionPool(host='mall.christine.com.cn', port=443): Max r ...

  4. python使用requests时报错requests.exceptions.SSLError: HTTPSConnectionPool

    报错信息 Traceback (most recent call last): File "<stdin>", line 1, in <module> Fi ...

  5. pycharm fiddler requests.exceptions.SSLError

    一.SSL问题1.不启用fiddler,直接发https请求,不会有SSL问题(也就是说不想看到SSL问题,关掉fiddler就行) 2.启动fiddler抓包,会出现这个错误:requests.ex ...

  6. 【Mac + ATX基于uiautomator2】使用weditor时,报错:requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))

    产生以下原因找到了:是因为启动了appium,两者冲突,不能同时使用. 之前讲过怎么安装u2([Mac安装,ATX基于uiautomator2]之安装步骤)以及使用weditor, 但是经过一段时间, ...

  7. python requests.exceptions.ConnectionError

    今天遇到一个奇葩问题, 1.r.request.post(url) 2..print r. status_code 居然第一步就报错了,原因是url不正确,按道理应该可以走到第二步然后输入404的 i ...

  8. requests.exceptions.SSLError……Max retries exceeded with url错误求助!!!

    import requests head = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Appl ...

  9. 【airtest, python】报错:requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')),解决方法如下

    环境及设备 mac, xcode , iphonex 问题 最近出现一个让人费解的问题,airtest 没跑多长时间,服务就断掉,而且总是报“requests.exceptions.Connectio ...

随机推荐

  1. [ios]object-c math.h里的数学计算公式介绍

    参考:http://blog.csdn.net/yuhuangc/article/details/7639117 头文件:<math.h> 1. 三角函数  double sin (dou ...

  2. nginx常用命令汇总

    nginx基础命令: sudo nginx // 开启nginx服务器 sudo nginx -s reload // 重启nginx服务器 sudo nginx -s stop // 关闭nginx ...

  3. 4-2 Ajax练习题,12结算!Check Out。

    练习题:在购物车的每个商品旁添加按钮,按一下减一个,数量为0删除该商品.先用普通方法再用Ajax支持. 1.自定义方法decrease, 为其设定路径routes.rb. 在resouurces :l ...

  4. 1月10日 ruby基础教程,查漏补缺; 2月22日 Exception补充

    https://ruby-doc.org/core-2.5.0/Exception.html 1月20日练习完1,2章. 第一章 初探 ‘’单引号不执行转义符. \t 制表符.\n 换行符. p me ...

  5. array_unshift

    <!DOCTYPE html> <html> <body> <?php $a=array(0=>"red",1=>" ...

  6. python-day21--time模块

    一.三种表示方法 1.时间戳(timestamp): time.time( )       #得到的是float类型 2.格式化(Format String): time.strftime('%Y/% ...

  7. CF808D STL

    D. Array Division time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...

  8. UA 列表

    设备 系统 浏览器 User-Agent iPhone IOS QQ浏览器 Mozilla/5.0 (iPhone 84; CPU iPhone OS 10_3_3 like Mac OS X) Ap ...

  9. form数据请求参数格式

    请求后台参数格式问题 当请求后台传递参数时,有多中类型,而每一种都需要前后台进行配合,而这有时候会很简单,有时候却十分困难,记录一下,以备后期深究 数据 后台需要的数据 form表单 嵌套数据,第二层 ...

  10. MySQL使用全文索引(fulltext index)---高性能

    转载地址:https://blog.csdn.net/u011734144/article/details/52817766/ 1.创建全文索引(FullText index) 旧版的MySQL的全文 ...