dongzhaorui пре 3 година
родитељ
комит
30da8ddd31
1 измењених фајлова са 2 додато и 3 уклоњено
  1. 2 3
      find_source/crawler/utils.py

+ 2 - 3
find_source/crawler/utils.py

@@ -20,10 +20,10 @@ def extract_base_url(url):
     return f"{_s}://{_h}/" if _p is None else f"{_s}://{_h}:{_p}/"
 
 
-def extract_host(url):
+def extract_domain(url):
     """
 
-    # >>> base_url = extract_host('http://192.168.3.207:8080/')
+    # >>> base_url = extract_domain('http://192.168.3.207:8080/')
     """
     _, host, port = get_host(url)
     return f"{host}" if port is None else f"{host}:{port}"
@@ -32,4 +32,3 @@ def extract_host(url):
 def extract_page_title(html):
     element = html2element(html)
     return "".join(element.xpath('/html/head/title/text()')).strip()
-