user4986561
user4986561

Reputation:

Invalid URL: No host supplied : error while using Request.get(url) in Python

Code:

img=requests.get('http:////files.explosm.net/comics/Rob/chainsaw.png')

Error Message:

requests.exceptions.InvalidURL: Invalid URL u'http://files.explosm.net/comics/Rob/chainsaw.png': No host supplied

What's wrong with the url? files.explosm.net/comics/Rob/chainsaw.png

Upvotes: 5

Views: 25259

Answers (1)

hd1
hd1

Reputation: 34677

You have a few too many '/'s in the URL:

img = requests.get('http://files.explosm.net/comics/Rob/chainsaw.png')

Hope that helps.

Upvotes: 13

Related Questions