Skip to content

Commit 2a9ab69

Browse files
committed
Strip out the scheme from the server address URI
1 parent 81f89d8 commit 2a9ab69

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scrapegraphai/utils/proxy_rotation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import ipaddress
66
import random
7+
import re
78
from typing import List, Optional, Set, TypedDict
89

910
import requests
@@ -230,7 +231,7 @@ def parse_or_search_proxy(proxy: Proxy) -> ProxySettings:
230231
"""
231232
assert "server" in proxy, "missing server in the proxy configuration"
232233

233-
server_address = proxy["server"].split(":", maxsplit=1)[0]
234+
server_address = re.sub(r'^\w+://', '', proxy["server"]).split(":", maxsplit=1)[0]
234235

235236
if is_ipv4_address(server_address):
236237
return _parse_proxy(proxy)

0 commit comments

Comments
 (0)