Jan-01-2025, 08:13 PM
Hello,
I am encountering an issue where I am unable to insert a map generated in Folium into a PDF file. This type of error pops out:
If you identify any issues, please provide your suggestions below. Additionally, if you any further recommendations for enhancing the code, kindly share your comments.
Thank you in advance
John
I am encountering an issue where I am unable to insert a map generated in Folium into a PDF file. This type of error pops out:
Error:WebDriverException Traceback (most recent call last)
<ipython-input-4-17d956ce3c91> in <cell line: 80>()
78
79 # Use ChromeDriverManager to get the correct ChromeDriver path and version
---> 80 driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
81
82 # Load the saved HTML file
5 frames
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chrome/webdriver.py in __init__(self, options, service, keep_alive)
43 options = options if options else Options()
44
---> 45 super().__init__(
46 browser_name=DesiredCapabilities.CHROME["browserName"],
47 vendor_prefix="goog",
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/webdriver.py in __init__(self, browser_name, vendor_prefix, options, service, keep_alive)
64
65 try:
---> 66 super().__init__(command_executor=executor, options=options)
67 except Exception:
68 self.quit()
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py in __init__(self, command_executor, keep_alive, file_detector, options, locator_converter, web_element_cls, client_config)
239 self._authenticator_id = None
240 self.start_client()
--> 241 self.start_session(capabilities)
242 self._fedcm = FedCM(self)
243
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py in start_session(self, capabilities)
327
328 caps = _create_caps(capabilities)
--> 329 response = self.execute(Command.NEW_SESSION, caps)["value"]
330 self.session_id = response.get("sessionId")
331 self.caps = response.get("capabilities")
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params)
382 response = self.command_executor.execute(driver_command, params)
383 if response:
--> 384 self.error_handler.check_response(response)
385 response["value"] = self._unwrap_value(response.get("value", None))
386 return response
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response)
230 alert_text = value["alert"].get("text")
231 raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here
--> 232 raise exception_class(message, screen, stacktrace)
WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x578483f2e4e3 <unknown>
#1 0x578483c5dc76 <unknown>
#2 0x578483c86d78 <unknown>
#3 0x578483c83029 <unknown>
#4 0x578483cc1ccc <unknown>
#5 0x578483cc147f <unknown>
#6 0x578483cb8de3 <unknown>
#7 0x578483c8e2dd <unknown>
#8 0x578483c8f34e <unknown>
#9 0x578483eee3e4 <unknown>
#10 0x578483ef23d7 <unknown>
#11 0x578483efcb20 <unknown>
#12 0x578483ef3023 <unknown>
#13 0x578483ec11aa <unknown>
#14 0x578483f176b8 <unknown>
#15 0x578483f17847 <unknown>
#16 0x578483f27243 <unknown>
#17 0x7ed02e9d0ac3 <unknown>
I will provide the code if it is necessary.If you identify any issues, please provide your suggestions below. Additionally, if you any further recommendations for enhancing the code, kindly share your comments.
Thank you in advance
John