Skip to content

Commit 8ffd3a2

Browse files
committed
Ignore parsing urls that don't have :// in them (ex: about:blank)
1 parent 592dfba commit 8ffd3a2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

seleniumbase/fixtures/page_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def get_domain_url(url):
1313
Into this:
1414
https://blog.xkcd.com
1515
"""
16+
if "http://" not in url and "https://" not in url:
17+
return url
1618
url_header = url.split('://')[0]
1719
simple_url = url.split('://')[1]
1820
base_url = simple_url.split('/')[0]
@@ -71,6 +73,8 @@ def _get_unique_links(page_url, soup):
7173
Includes:
7274
"a"->"href", "img"->"src", "link"->"href", and "script"->"src" links.
7375
"""
76+
if "http://" not in page_url and "https://" not in page_url:
77+
return []
7478
prefix = 'http:'
7579
if page_url.startswith('https:'):
7680
prefix = 'https:'

0 commit comments

Comments
 (0)