Closed migoya2020 closed 2 years ago
Sorry this is what i am using: replace the FAKEAPI
'proxy':{ "url_http": "http://FAKEAPI@proxy.scrapingbee.com:8886", "url_https": "https://FAKEAPI@proxy.scrapingbee.com:8887", "url_socks5": "socks5://FAKEAPI@socks.scrapingbee.com:8888", }
You should specify a http proxy or socks proxy rather than both (socks will just override the other). Also, when using a http proxy, the URLs (including the ports) should be the same.
So you should be able to do this:
'proxy': {
'http': 'http://FAKEAPI@proxy.scrapingbee.com:8887',
'https': 'https://FAKEAPI@proxy.scrapingbee.com:8887',
}
or this:
'proxy': {
'http': 'socks5://FAKEAPI@socks.scrapingbee.com:8888',
'https': 'socks5://FAKEAPI@socks.scrapingbee.com:8888',
}
When i use your solution i get this Error
WARNING:seleniumwire.server:127.0.0.1:40584: request -> HTTP protocol error in client request: Server disconnected
that is for https that i want to use
I have the same problem with an auth. proxy (from surfshark). I scrolled through older issues and did not find a solution. Is there still no solve? Btw, I tried
'verify_ssl': False,
'mitm_http2': False,
with no luck whatsoever. The proxy works with requests package.
Just in case, here is my log:
DEBUG:selenium.webdriver.remote.remote_connection:POST http://127.0.0.1:64590/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "chrome", "platformName": "any", "proxy": {"proxyType": "manual", "httpProxy": "127.0.0.1:64589", "sslProxy": "127.0.0.1:64589", "noProxy": []}, "acceptInsecureCerts": true, "goog:chromeOptions": {"extensions": [], "args": ["--proxy-bypass-list=<-loopback>"]}}}, "desiredCapabilities": {"browserName": "chrome", "version": "", "platform": "ANY", "proxy": {"proxyType": "manual", "httpProxy": "127.0.0.1:64589", "sslProxy": "127.0.0.1:64589", "noProxy": []}, "acceptInsecureCerts": true, "goog:chromeOptions": {"extensions": [], "args": ["--proxy-bypass-list=<-loopback>"]}}}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1:64590
DEBUG:seleniumwire.server:127.0.0.1:60387: clientconnect
DEBUG:seleniumwire.server:127.0.0.1:60387: serverconnect
-> ('cy-nic.prod.surfshark.com', 443)
WARNING:seleniumwire.server:127.0.0.1:60387: request
-> HTTP protocol error in client request: Server disconnected
DEBUG:seleniumwire.server:127.0.0.1:60387: serverdisconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:60387: clientdisconnect
DEBUG:urllib3.connectionpool:http://127.0.0.1:64590 "POST /session HTTP/1.1" 200 842
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
DEBUG:selenium.webdriver.remote.remote_connection:POST http://127.0.0.1:64590/session/0f1b4bff187917a846f4c05069387b7c/url {"url": "https://whatismyipaddress.com/"}
DEBUG:seleniumwire.server:127.0.0.1:49589: clientconnect
DEBUG:seleniumwire.server:127.0.0.1:61730: clientconnect
DEBUG:seleniumwire.server:127.0.0.1:61730: serverconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:49589: serverconnect
-> ('cy-nic.prod.surfshark.com', 443)
WARNING:seleniumwire.server:127.0.0.1:49589: request
-> HTTP protocol error in client request: Server disconnected
DEBUG:seleniumwire.server:127.0.0.1:49589: serverdisconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:49589: clientdisconnect
WARNING:seleniumwire.server:127.0.0.1:61730: request
-> HTTP protocol error in client request: Server disconnected
DEBUG:seleniumwire.server:127.0.0.1:61730: serverdisconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:61730: clientdisconnect
DEBUG:seleniumwire.server:127.0.0.1:64324: clientconnect
DEBUG:seleniumwire.server:127.0.0.1:54135: clientconnect
DEBUG:seleniumwire.server:127.0.0.1:54135: serverconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:64324: serverconnect
-> ('cy-nic.prod.surfshark.com', 443)
WARNING:seleniumwire.server:127.0.0.1:54135: request
-> HTTP protocol error in client request: Server disconnected
DEBUG:seleniumwire.server:127.0.0.1:54135: serverdisconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:54135: clientdisconnect
WARNING:seleniumwire.server:127.0.0.1:64324: request
-> HTTP protocol error in client request: Server disconnected
DEBUG:seleniumwire.server:127.0.0.1:64324: serverdisconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:64324: clientdisconnect
DEBUG:seleniumwire.server:127.0.0.1:59199: clientconnect
DEBUG:seleniumwire.server:127.0.0.1:49761: clientconnect
DEBUG:seleniumwire.server:127.0.0.1:59199: serverconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:49761: serverconnect
-> ('cy-nic.prod.surfshark.com', 443)
WARNING:seleniumwire.server:127.0.0.1:59199: request
-> HTTP protocol error in client request: Server disconnected
DEBUG:seleniumwire.server:127.0.0.1:59199: serverdisconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:59199: clientdisconnect
WARNING:seleniumwire.server:127.0.0.1:49761: request
-> HTTP protocol error in client request: Server disconnected
DEBUG:seleniumwire.server:127.0.0.1:49761: serverdisconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:49761: clientdisconnect
DEBUG:urllib3.connectionpool:http://127.0.0.1:64590 "POST /session/0f1b4bff187917a846f4c05069387b7c/url HTTP/1.1" 500 1136
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
Traceback (most recent call last):
File "C:\Users\maxik\Documents\PythonProjects\availabilityBot\vpn_selenium_test.py", line 47, in <module>
driver.get(url)
File "C:\Anaconda\envs\selenium-env\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get
self.execute(Command.GET, {'url': url})
File "C:\Anaconda\envs\selenium-env\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Anaconda\envs\selenium-env\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: unknown error: net::ERR_TUNNEL_CONNECTION_FAILED
(Session info: chrome=91.0.4472.77)
DEBUG:seleniumwire.server:127.0.0.1:55123: clientconnect
DEBUG:seleniumwire.server:127.0.0.1:55123: serverconnect
-> ('cy-nic.prod.surfshark.com', 443)
WARNING:seleniumwire.server:127.0.0.1:55123: request
-> HTTP protocol error in client request: Server disconnected
DEBUG:seleniumwire.server:127.0.0.1:55123: serverdisconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:55123: clientdisconnect
DEBUG:seleniumwire.server:127.0.0.1:59667: clientconnect
DEBUG:seleniumwire.server:127.0.0.1:59667: serverconnect
-> ('cy-nic.prod.surfshark.com', 443)
WARNING:seleniumwire.server:127.0.0.1:59667: request
-> HTTP protocol error in client request: Server disconnected
DEBUG:seleniumwire.server:127.0.0.1:59667: serverdisconnect
-> ('cy-nic.prod.surfshark.com', 443)
DEBUG:seleniumwire.server:127.0.0.1:59667: clientdisconnect
@luxorbis are you able to post your proxy config, including the selenium_wire options your using?
Sure
from seleniumwire import webdriver
import logging logging.basicConfig(level=logging.DEBUG)
wire_options = {
'verify_ssl': False,
'mitm_http2': False,
'proxy': {
'https':'https://
PATH = '
url = "https://whatismyipaddress.com/" driver.get(url)
I did not specify a port since I did not have to in _requests_, but even with some generic ports like 8080 or 443 I get nothing.
The server I am trying to connect to is from Cyprus. I do not know whether it is just a plain proxy server or some special vpn server, but what I do know is that I can connect to it with _requests_, the windows _nslookup_ command gives me this:
Name: cy-nic.prod.surfshark.com Addresses: 195.47.194.99 195.47.194.64
When i use your solution i get this Error
WARNING:seleniumwire.server:127.0.0.1:40584: request -> HTTP protocol error in client request: Server disconnected
that is for https that i want to use
Any idea where this error is coming from?
@migoya2020 did you also try adding 'mitm_http2': False
to your seleniumwire_options
?
Closing due to inactivity.
Any success ?
**sw_options = { 'proxys': { "http": "http://FAKEAPI:render_js=False&premium_proxy=True@proxy.scrapingbee.com:8886", "https": "https://FAKEAPI:render_js=False&premium_proxy=True@proxy.scrapingbee.com:8887", }, 'mitm_http2': False, }
profile.set_preference("javascript.enabled", False) driver = uc.Chrome(
options=chrome_options, seleniumwire_options=sw_options )**
this worked for me.
This doesn't work for me
ValueError: Different settings for http and https proxy servers not supported
i am trying to connect a Scrapingbee proxy and i get an error: { "http": "@proxy.scrapingbee.com:8886"
"https": "@proxy.scrapingbee.com:8887"
"socks5": "@socks.scrapingbee.com:8888"
}
The Error:
ValueError: Different settings for http and https proxy servers not supported