-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Message: session not created: Chrome failed to start: exited normally.(session not created: DevToolsActivePort file doesn't exist)(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) #2247
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
Comments
Greetings. Let's go through your code and give you some solutions to work with... You've got multiple recursive calls happening with ![]() The officially-supported way of doing multithreading in UC Mode is by using Depending on your Ubuntu configuration, you may need to use You may be overcomplicating your from seleniumbase import BaseCase
from selenium_stealth import stealth
class BaseTestCase(BaseCase):
def setUp(self):
super().setUp()
stealth(self.driver,
languages=["en-US", "en"],
vendor="Google Inc.",
platform="Win32",
webgl_vendor="Intel Inc.",
renderer="Intel Iris OpenGL Engine",
fix_hairline=True,
) Then have your test classes inherit SeleniumBase methods have automatic-waiting. You should never be using the external Also note that you have unused code in your examples. You declared Finally, |
@mdmintz I found the issue point |
Are your proxy strings in a valid format? Are you using multithreading / multiple proxies? (Then use from parameterized import parameterized
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__, "-n3")
class ProxyTests(BaseCase):
@parameterized.expand(
[
["user1:pass1@host1:port1"],
["user2:pass2@host2:port2"],
["user3:pass3@host3:port3"],
]
)
def test_multiple_proxies(self, proxy_string):
self.get_new_driver(
undetectable=True, proxy=proxy_string, multi_proxy=True
)
self.driver.get("https://browserleaks.com/webrtc")
self.sleep(30) Or if not using multithreading and not using multiple proxies at the same time, here's a way to do it using the driver = Driver(uc=True, proxy="user:pass@host:port") |
@mdmintz Nope, just a single driver at a time |
Do you have a stack trace? It'll make it easier to debug. |
Ok, give me a minute, i will make a sample script and test it |
|
Same simple raw driver |
I think you missed a few important parts from my original answer:
So, don't use And your script still has a recursive call in it, which could lead to multiple drivers, which may crash because you weren't using And remember that SeleniumBase methods have automatic-waiting. You should never be using the external implicitly_wait, WebDriverWait, or EC.presence_of_element_located anywhere in your code. Use the built-in methods instead. |
I have made some tests with print. Turning on proxy kills further script running.It freezes for a while and then gives an error =( |
Chrome headless mode doesn't support extensions. If you have to run on a headless machine, use |
I understand, but without proxy headless works. Sorry if I misunderstood |
OMG. It worked! driver = sb.Driver(browser='chrome', headless2=True, uc=True, proxy=proxy) |
Yes, because proxy settings are set via a Chrome extension that gets generated at runtime. If you don't use proxy with auth, then you don't have a Chrome extension, and therefore regular headless mode works fine. (Hence the reason for Chrome's newer headless mode, which is set with |
There's a popular StackOverflow post about it: https://stackoverflow.com/a/73840130/7058266 |
@mdmintz Thank you so much! I hope you won't see me with my stupid questions soon=). I will rewrite all my code from selenium-wire to your framework, I like your Tracebacks they are so detailed and helpful |
Yes i used it once but in original selenium(some elements were not displayed on screenshots via old headless mode). Gosh... |
driver = sb.Driver(browser='chrome', headless2=True, uc=True, proxy=proxy) |
After a quick refresher, I recalled that the from sbvirtualdisplay import Display
from seleniumbase import Driver
display = Display(visible=0, size=(1440, 1880))
display.start()
driver = Driver()
try:
driver.open("seleniumbase.github.io/demo_page")
driver.highlight("h2")
driver.type("#myTextInput", "Automation")
driver.click("#checkBox1")
driver.highlight("img", loops=6)
finally:
driver.quit()
display.stop() |
Thank you. This is a stable solution |
I'm sorry for may be being stupid, but..
Bug only on ubuntu 22.04. On Windows 11 no issues!
I have been struggling with this problem for several days:
THIS CODE WORKS ON UBUNTU 22.04:
THIS CODE ALWAYS FAILS ON UBUNTU 22.04:
I was debugging alot. On Windows 11 no issues!
Only this code can go through Cloudflare on a target site
Thank you!
The text was updated successfully, but these errors were encountered: