Skip to content

Commit c3ed25d

Browse files
authored
Merge pull request #3492 from seleniumbase/more-proxy-schemes
More proxy schemes
2 parents d3aab4a + 067e29c commit c3ed25d

File tree

4 files changed

+13
-21
lines changed

4 files changed

+13
-21
lines changed

examples/proxy_test.py

+9-17
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,19 @@ def test_proxy(self):
1616
self.open("https://api.ipify.org/")
1717
ip_address = self.get_text("body")
1818
self.open("https://ipinfo.io/")
19-
self.type('input[name="search"]', ip_address, timeout=20)
20-
self.click("form button span")
21-
self.sleep(2)
22-
self.click_if_visible("span.cursor-pointer", timeout=4)
19+
self.type('input[name="search"]\n', ip_address, timeout=20)
2320
print("\n\nMy IP Address = %s\n" % ip_address)
21+
self.wait_for_text("IP Address", "h1", timeout=20)
22+
self.wait_for_element_present('[href="/signup"]')
23+
self.wait_for_text("hostname", timeout=20)
24+
self.highlight("h1")
25+
self.sleep(1.5)
2426
print("Displaying Host Info:")
25-
text = self.get_text("#block-summary").split("Hosted domains")[0]
27+
text = self.get_text("#api-preview-widget").split("is_anycast:")[0]
2628
rows = text.split("\n")
2729
data = []
2830
for row in rows:
2931
if row.strip() != "":
3032
data.append(row.strip())
31-
print("\n".join(data).replace('\n"', " "))
32-
print("\nDisplaying Geolocation Info:")
33-
text = self.get_text("#block-geolocation").split("Coordinates")[0]
34-
rows = text.split("\n")
35-
data = []
36-
for row in rows:
37-
if row.strip() != "":
38-
data.append(row.strip())
39-
print("\n".join(data).replace('\n"', " "))
40-
if not self.headless:
41-
print("\nThe browser will close automatically in 3 seconds...")
42-
self.sleep(3)
33+
print("\n".join(data).replace('\n"', ' "'))
34+
self.sleep(3)

seleniumbase/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.34.10"
2+
__version__ = "4.34.11"

seleniumbase/config/proxy_list.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"""
2424

2525
PROXY_LIST = {
26-
"example1": "35.185.196.38:3128", # (Example) - set your own proxy here
27-
"example2": "129.80.134.71:3128", # (Example)
26+
"example1": "98.8.195.160:443", # (Example) - set your own proxy here
27+
"example2": "200.174.198.86:8888", # (Example)
2828
"example3": "socks5://184.178.172.5:15303", # (Example)
2929
"proxy1": None,
3030
"proxy2": None,

seleniumbase/core/proxy_helper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def create_proxy_ext(
4040
""" mode: "fixed_servers",\n"""
4141
""" rules: {\n"""
4242
""" singleProxy: {\n"""
43-
""" scheme: "http",\n"""
43+
""" scheme: ["http", "https", "socks4", "socks5"],\n"""
4444
""" host: "%s",\n"""
4545
""" port: parseInt("%s")\n"""
4646
""" },\n"""

0 commit comments

Comments
 (0)