3

Code Image

This is the simple program I am trying to run which shows error. If I pass URL without whitespace, then the program runs properly.

Error: 404 Bad Request.

Error

If instead of "Hey You", I pass "Hey%20You". The program runs correctly.

oneimperfectguy
  • 952
  • 8
  • 13
  • 1
    It would be better if you don't paste images but instead include the code. Check the formatting FAQ if you want to know how to format code. – Thom Wiggers Feb 27 '17 at 14:40

1 Answers1

3

You can pass the string to urllib.parse.quote to handle the escaping of special characters such as the space.

Thom Wiggers
  • 6,938
  • 1
  • 39
  • 65