1

When I run the following code in Python3.4 on Windows8.1:

r = requests.get(url)

It returns, among other things:

File "C:\Python34\lib\site-packages\requests\sessions.py", line 644, in get_adapter
   raise InvalidSchema("No connection adapters were found for '%s'" % url) requests.exceptions.InvalidSchema: No connection adapters were found for '"http://example.com"'

Is this simply a problem with my code, my firewall or something else entirely? How would I go about fixing it?

4
  • 2
    it's a problem with your url i guess, the url supposed to be like this - "example.com", not like this '"example.com"' Commented Jan 26, 2016 at 18:36
  • @minitoto you mean without quotes? Could be, let me check. Commented Jan 26, 2016 at 18:38
  • @minitoto Yup, that was it (I'd implemented input() improperly somewhere). Thanks! Commented Jan 26, 2016 at 18:39
  • 1
    I faced the same message when I used 'localhost:5000' instead of 'http://localhost:5000'. In other words, the message seems to be related to requests not finding a proper protocol. Commented Aug 5, 2022 at 12:42

1 Answer 1

5

change your get request to use only one type of quotes:

requests.get("http://example.com")

you are trying to do it with two types of quotes at the same time and it gives a proper error:

requests.get('"http://example.com"')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.