Skip to content

Commit 584f95c

Browse files
committed
Make sure special characters are kept when getting the URL
1 parent c8014b4 commit 584f95c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,14 @@ def refresh(self):
435435
self.refresh_page()
436436

437437
def get_current_url(self):
438-
return self.driver.current_url
438+
current_url = self.driver.current_url
439+
if "%" in current_url and sys.version_info[0] >= 3:
440+
try:
441+
from urllib.parse import unquote
442+
current_url = unquote(current_url, errors='strict')
443+
except Exception:
444+
pass
445+
return current_url
439446

440447
def get_page_source(self):
441448
self.wait_for_ready_state_complete()

0 commit comments

Comments
 (0)