-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documenting the selenium-wire
integration with the Driver()
manager
#2145
Comments
I added documentation on the |
Also for def set_wire_proxy(string):
"""Examples:
set_wire_proxy("SERVER:PORT")
set_wire_proxy("socks5://SERVER:PORT")
set_wire_proxy("USERNAME:PASSWORD@SERVER:PORT")
"""
the_http = "http"
the_https = "https"
if string.startswith("socks4://"):
the_http = "socks4"
the_https = "socks4"
elif string.startswith("socks5://"):
the_http = "socks5"
the_https = "socks5"
string = string.split("//")[-1]
driver.proxy = {
"http": "%s://%s" % (the_http, string),
"https": "%s://%s" % (the_https, string),
"no_proxy": "localhost,127.0.0.1",
} |
The
|
Do you have plans to make wire mode and uc mode compatible in the future? |
There's But the good news is that you don't need the wire integration anymore because SeleniumBase has Here's an example that uses it: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/uc_cdp_events.py |
Can I use uc_cdp=True with remote_debug = True? |
@guocity |
I mean work with existing remote debugging session with SB(headless=False, uc_cdp_events=True, remote_debug = True) as browser: # it won't work with existing remote debugging session |
@guocity What exactly do you mean by "it won't work"? The screenshot I took in #2145 (comment) was with |
I have a chrome opened with --remote-debugging-port=9222. In SB remote_debug = True, it will just use the existing chrome remote debug session open earlier. However, uc_cdp_events = True, it won't |
This is the main thing that options.set_capability("goog:loggingPrefs", {"performance": "ALL", "browser": "ALL"}) If that's causing some kind of port conflict, then that's from Selenium internals / Chrome internals. When you say, it won't "use the existing chrome remote debug session open earlier", what does it do instead? To help debug, I need to understand what you're seeing. There might not be much that I can do if the issue is on Selenium's end or Chrome's end. SeleniumBase only sets Also, it doesn't make sense why you're trying to connect to an existing Chrome in UC Mode. UC Mode spins up a new Chrome browser and attaches Selenium to it. If you just use |
I see, I don't need undetected, I want to see network request, I was using add_cdp_listener, and it's part of undetected, |
Then something like this might be all you need: from rich.pretty import pprint
from seleniumbase import SB
with SB(log_cdp=True, remote_debug=True) as sb:
url = "seleniumbase.io/demo_page"
sb.open(url)
sb.sleep(2)
pprint(sb.driver.get_log("performance")) |
Selenium-Wire features have been included in the new CDP Mode, which is part of UC Mode. See #3246 (comment) for details. |
Documenting the
selenium-wire
integration with theDriver()
managerHere's an example of the selenium-wire integration with the
Driver
manager:Here's the output of that:
The
wire
integration can also be activated via command-line option:--wire
Here's a more advanced example:
Here's some output from running that:
And note, (since it gets asked a lot),
wire
mode is not compatible withuc
mode!The text was updated successfully, but these errors were encountered: