标签:url ssi class ali image cep ant request mis
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
标签:url ssi class ali image cep ant request mis
原文地址:https://www.cnblogs.com/zengsf/p/9737559.html