Skip to content

Commit 688dcb9

Browse files
committed
If a URL is missing a prefix/protocol before open(), add https://
1 parent 5c1ac1f commit 688dcb9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ def open(self, url):
161161
# url should start with one of the following:
162162
# "http:", "https:", "://", "data:", "file:",
163163
# "about:", "chrome:", "opera:", or "edge:".
164-
msg = 'Did you forget to prefix your URL with "http:" or "https:"?'
165-
raise Exception('Invalid URL: "%s"\n%s' % (url, msg))
164+
if page_utils.is_valid_url("https://" + url):
165+
url = "https://" + url
166+
else:
167+
raise Exception('Invalid URL: "%s"!' % url)
166168
self.__last_page_load_url = None
167169
js_utils.clear_out_console_logs(self.driver)
168170
if url.startswith("://"):

0 commit comments

Comments
 (0)