We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 744e466 commit e03ef53Copy full SHA for e03ef53
microdata.py
@@ -4,6 +4,7 @@
4
import html5lib
5
6
from collections import defaultdict
7
+from urlparse import urlparse
8
9
10
try:
@@ -137,8 +138,9 @@ def get_domain(url_string):
137
138
"""
139
Get the domain _including_ the protocol specified, if any.
140
- if "://" in url_string:
141
- return "/".join(url_string.split("/")[0:3])
+ parsed = urlparse(url_string)
142
+ if parsed.scheme:
143
+ return "/".join(parsed.scheme, "", parsed.netloc)
144
else:
145
return url_string.split("/")[0]
146
0 commit comments