Comments (5)
Thanks @juhoarvid
FYI version 1.0.8 is now available which contains a configurable timeout option. You can set a specific value or use None
for no timeout. A default of 5 seconds is used if the option is omitted entirely.
options = {
'connection_timeout': None # Never timeout
}
driver = webdriver.Firefox(seleniumwire_options=options)
With regard to the 502 status, the tracebacks are in fact indirectly logged by the self.send_error(502)
call (it calls log_error()
in its super class). But, Selenium Wire intercepts that call and logs the message and traceback at debug
level. So it's possible that you're not seeing the tracebacks if you don't have your logging set to debug
- e.g.
import logging
logging.basicConfig(level=logging.DEBUG) # Set to debug to see tracebacks
The reason for using debug
level is to reduce a lot of harmless "noise" that may otherwise alarm users.
from selenium-wire.
Thanks for raising this. Currently the timeout value isn't configurable (hard coded to 5 seconds) but it would definitely make sense to make it configurable for situations such as this.
I'll make the change and update this issue once it's available.
from selenium-wire.
I was really needing that change and was planning to check do I have anything to give with my python skills. After taking 1.0.6 in use, I notice problem disappears even there is still that hardcoded timeout defined:
https://github.com/wkeeling/selenium-wire/blob/6bb6c61/seleniumwire/proxy/proxy2.py#L38
But that value is not used at all. Probably meaning no timeouts used for proxy bindings and therefore I did not face problem anymore with 1.0.6.
But If proxy timeout needed I still think this my ticket is valid.
from selenium-wire.
Thanks @juhoarvid - I think you've found a bug. Looks as though the variable name was changed in an earlier refactoring but is no longer used, so the default of no timeout is taking effect. I guess we should probably fix that and also make the value configurable at the same time.
from selenium-wire.
One comment to this.
After using selenium-wire 1.0.6 I phase 502 in certain conditions. I am using Robot Framework for doing test automation. Tests fails due to exceptions on robot framework implementation. Tracebacks which leads to 502 are not shown. After this issue I am thinking, should traceback which leads to 502 be shown? In this issue it at least seems not to be server issue and therefore 502 is misleading debugging (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502)
Probably:
selenium-wire/seleniumwire/proxy/proxy2.py
Line 116 in 6bb6c61
except Exception:
if origin in self.tls.conns:
del self.tls.conns[origin]
self.send_error(502)
return
Could be
(import traceback)
except Exception:
if origin in self.tls.conns:
del self.tls.conns[origin]
self.send_error(502)
traceback.print_exc()
return
or
except Exception as e:
if origin in self.tls.conns:
del self.tls.conns[origin]
self.send_error(502)
raise e
Or exception splitted to smaller part where different type of situations are handled with different error code. For instance #55 (comment) mention that Nginx returns in certain condition 499 while selenium-wire do 502.
from selenium-wire.
Related Issues (20)
- Websites with a domain in Cyrillic do not open HOT 3
- Don't load JS content on page HOT 1
- Valid proxies with credentials not working
- selenium-wire with proxy timing-out inside AWS Lambda
- Selenium Wire Remote instantiates with incorrect arguments HOT 2
- Full Traceback Displayed Reporting [WinError 10053] An established connection was aborted by the software in your host machine HOT 1
- ERR_PROXY_CONNECTION_FAILED while running selenium wire on Github Actions HOT 1
- Reduce HAR file size
- PFX/PKCS certificate not working
- How to use selenium-wire with dolphin anty webbrowser? + how to use proxy with interceptor? HOT 2
- Submit POST/PATCH/PUT instead of GET request HOT 1
- driver.requests is empty list with MSEdgedriver
- WebDriverException: Message: unknown error: session deleted because of page crash HOT 1
- Some error when use debuggerAddress on selenium-wire and how to fix it
- Problem to run code from terminal
- SeleniumWire Unable to Intercept Network with Samsung S23 android user-agent
- Error handling request in HAR with large timestamp in cookie
- Unable to get content of page from special characters (utf-8) URL HOT 1
- Dynamic Proxy Changing is not working (?) with Flag "--ignore-certificate-errors"
- Add `py.typed` marker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from selenium-wire.