Skip to content

Commit 3ed98c4

Browse files
Selenium python proxy (SeleniumHQ#317)
* python selenium proxy * python selenium proxy Co-authored-by: Diego Molina <[email protected]>
1 parent b655c60 commit 3ed98c4

8 files changed

+120
-8
lines changed

docs_source_files/content/webdriver/http_proxies.de.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,21 @@ public class proxyTest {
4040
}
4141
{{< / code-panel >}}
4242
{{< code-panel language="python" >}}
43-
# Need PR
43+
from selenium import webdriver
44+
45+
PROXY = "<HOST:PORT>"
46+
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
47+
"httpProxy": PROXY,
48+
"ftpProxy": PROXY,
49+
"sslProxy": PROXY,
50+
"proxyType": "MANUAL",
51+
52+
}
53+
54+
with webdriver.Firefox() as driver:
55+
# Open URL
56+
driver.get("https://selenium.dev")
57+
4458
{{< / code-panel >}}
4559
{{< code-panel language="csharp" >}}
4660
// Need pr

docs_source_files/content/webdriver/http_proxies.en.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,21 @@ public class proxyTest {
4343
}
4444
{{< / code-panel >}}
4545
{{< code-panel language="python" >}}
46-
# Need PR
46+
from selenium import webdriver
47+
48+
PROXY = "<HOST:PORT>"
49+
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
50+
"httpProxy": PROXY,
51+
"ftpProxy": PROXY,
52+
"sslProxy": PROXY,
53+
"proxyType": "MANUAL",
54+
55+
}
56+
57+
with webdriver.Firefox() as driver:
58+
# Open URL
59+
driver.get("https://selenium.dev")
60+
4761
{{< / code-panel >}}
4862
{{< code-panel language="csharp" >}}
4963
// Need pr

docs_source_files/content/webdriver/http_proxies.es.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,21 @@ public class proxyTest {
5050
}
5151
{{< / code-panel >}}
5252
{{< code-panel language="python" >}}
53-
# Need PR
53+
from selenium import webdriver
54+
55+
PROXY = "<HOST:PORT>"
56+
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
57+
"httpProxy": PROXY,
58+
"ftpProxy": PROXY,
59+
"sslProxy": PROXY,
60+
"proxyType": "MANUAL",
61+
62+
}
63+
64+
with webdriver.Firefox() as driver:
65+
# Open URL
66+
driver.get("https://selenium.dev")
67+
5468
{{< / code-panel >}}
5569
{{< code-panel language="csharp" >}}
5670
// Need pr

docs_source_files/content/webdriver/http_proxies.fr.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,21 @@ public class proxyTest {
4444
}
4545
{{< / code-panel >}}
4646
{{< code-panel language="python" >}}
47-
# Need PR
47+
from selenium import webdriver
48+
49+
PROXY = "<HOST:PORT>"
50+
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
51+
"httpProxy": PROXY,
52+
"ftpProxy": PROXY,
53+
"sslProxy": PROXY,
54+
"proxyType": "MANUAL",
55+
56+
}
57+
58+
with webdriver.Firefox() as driver:
59+
# Open URL
60+
driver.get("https://selenium.dev")
61+
4862
{{< / code-panel >}}
4963
{{< code-panel language="csharp" >}}
5064
// Need pr

docs_source_files/content/webdriver/http_proxies.ja.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,21 @@ public class proxyTest {
3838
}
3939
{{< / code-panel >}}
4040
{{< code-panel language="python" >}}
41-
# Need PR
41+
from selenium import webdriver
42+
43+
PROXY = "<HOST:PORT>"
44+
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
45+
"httpProxy": PROXY,
46+
"ftpProxy": PROXY,
47+
"sslProxy": PROXY,
48+
"proxyType": "MANUAL",
49+
50+
}
51+
52+
with webdriver.Firefox() as driver:
53+
# Open URL
54+
driver.get("https://selenium.dev")
55+
4256
{{< / code-panel >}}
4357
{{< code-panel language="csharp" >}}
4458
// Need pr

docs_source_files/content/webdriver/http_proxies.ko.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,21 @@ public class proxyTest {
5050
}
5151
{{< / code-panel >}}
5252
{{< code-panel language="python" >}}
53-
# Need PR
53+
from selenium import webdriver
54+
55+
PROXY = "<HOST:PORT>"
56+
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
57+
"httpProxy": PROXY,
58+
"ftpProxy": PROXY,
59+
"sslProxy": PROXY,
60+
"proxyType": "MANUAL",
61+
62+
}
63+
64+
with webdriver.Firefox() as driver:
65+
# Open URL
66+
driver.get("https://selenium.dev")
67+
5468
{{< / code-panel >}}
5569
{{< code-panel language="csharp" >}}
5670
// Need pr

docs_source_files/content/webdriver/http_proxies.nl.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,21 @@ public class proxyTest {
4949
}
5050
{{< / code-panel >}}
5151
{{< code-panel language="python" >}}
52-
# Need PR
52+
from selenium import webdriver
53+
54+
PROXY = "<HOST:PORT>"
55+
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
56+
"httpProxy": PROXY,
57+
"ftpProxy": PROXY,
58+
"sslProxy": PROXY,
59+
"proxyType": "MANUAL",
60+
61+
}
62+
63+
with webdriver.Firefox() as driver:
64+
# Open URL
65+
driver.get("https://selenium.dev")
66+
5367
{{< / code-panel >}}
5468
{{< code-panel language="csharp" >}}
5569
// Need pr

docs_source_files/content/webdriver/http_proxies.zh-cn.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,21 @@ public class proxyTest {
4343
}
4444
{{< / code-panel >}}
4545
{{< code-panel language="python" >}}
46-
# Need PR
46+
from selenium import webdriver
47+
48+
PROXY = "<HOST:PORT>"
49+
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
50+
"httpProxy": PROXY,
51+
"ftpProxy": PROXY,
52+
"sslProxy": PROXY,
53+
"proxyType": "MANUAL",
54+
55+
}
56+
57+
with webdriver.Firefox() as driver:
58+
# Open URL
59+
driver.get("https://selenium.dev")
60+
4761
{{< / code-panel >}}
4862
{{< code-panel language="csharp" >}}
4963
// Need pr

0 commit comments

Comments
 (0)