0

Whenever I paste a URL into my Python output window in PyCharm it automatically realizes that the URL is a link and when running the program that asks for the user to enter the URL it will automatically take you to the website instead of storing the URL in the input variable I made for it, I fixed this problem by removing the https:// for the URL and concatenation http:// to the URL after it's entered.

But I want the user to be able to paste the URL straight in without having to remove https://, is it possible?

  • 4
    This is a known bug/feature in pycharm. Not much you can do about it: https://youtrack.jetbrains.com/issue/PY-24193 On the upside, as long as your users are not using pycharm there is no problem – blues Jul 17 '19 at 07:50
  • Can you update this question with your tried code and please mention Pycharm version? Because I didn't get any error. – Kushan Gunasekera Jul 17 '19 at 07:55
  • This question looks related: https://stackoverflow.com/questions/52067414/how-to-pass-urls-as-user-input-to-invoke-through-selenium-and-python – Georgy Jul 17 '19 at 08:05

1 Answers1

0

It is really functionality of pycharm , which we are referring as bug.

print("enter url with one space at last.")
url=input()[:-1:]
print(url)

we can't fix the bug, but can make ways to tackle it ....

enter image description here


but worst case is when we write

url=input("enter a url")
print(url)

enter image description here

In worst case we can't press enter even , no browser is opening, just program stucks..

Jainil Patel
  • 1,284
  • 7
  • 16