[GH-ISSUE #90] Bug features crashing selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 0 #68

Open
opened 2026-03-02 04:06:34 +03:00 by kerem · 13 comments
Owner

Originally created by @zakblacki on GitHub (Jan 24, 2025).
Original GitHub issue: https://github.com/FujiwaraChoki/MoneyPrinterV2/issues/90

Here is my config.json

    `{
      "verbose": true,
      "firefox_profile": "/Users/g-besoin/Library/Application Support/Firefox/Profiles/3ofmjrlf.default",
      "headless": false,
      "twitter_language": "English",
      "llm": "gpt4",
      "image_prompt_llm": "gpt4",
      "image_model": "v3",
      "threads": 3,
      "zip_url": "",
      "is_for_kids": false,
      "google_maps_scraper": "https://github.com/gosom/google-maps-scraper/archive/refs/tags/v1.7.5.zip",
      "email": {
        "smtp_server": "smtp.gmail.com",
        "smtp_port": 587,
        "username": "",
        "password": ""
      },
      "google_maps_scraper_niche": "",
      "scraper_timeout": 300,
      "outreach_message_subject": "I have a question...",
      "outreach_message_body_file": "outreach_message.html",
      "assembly_ai_api_key": "XXXXXmyAPI",
      "font": "bold_font.ttf",
      "imagemagick_path": "/opt/homebrew/bin/convert"
    }
    `
    

Here's the error log :

ℹ️ Starting YT Shorts Automater...
+----+--------------------------------------+----------+---------+
| ID |                 UUID                 | Nickname |  Niche  |
+----+--------------------------------------+----------+---------+
| 1  | 969d7784-0bfb-4c5a-b4e4-5c15244cee78 | zakblack | science |
+----+--------------------------------------+----------+---------+
❓ Select an account to start: 1
Traceback (most recent call last):
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module>
    main()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 92, in main
    youtube = YouTube(
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/YouTube.py", line 83, in __init__
    self.browser: webdriver.Firefox = webdriver.Firefox(service=self.service, options=self.options)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__
    super().__init__(command_executor=executor, options=options)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 250, in __init__
    self.start_session(capabilities)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 342, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
    self.error_handler.check_response(response)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 0

ℹ️ Starting Twitter Bot...
+----+--------------------------------------+----------+---------------+
| ID |                 UUID                 | Nickname | Account Topic |
+----+--------------------------------------+----------+---------------+
| 1  | fb3e2275-3f83-422a-93fc-28160d14fcce | zakblack |    science    |
+----+--------------------------------------+----------+---------------+
❓ Select an account to start: 1
Traceback (most recent call last):
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module>
    main()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 212, in main
    twitter = Twitter(selected_account["id"], selected_account["nickname"], selected_account["firefox_profile"], selected_account["topic"])
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/Twitter.py", line 59, in __init__
    self.browser: webdriver.Firefox = webdriver.Firefox(service=self.service, options=self.options)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__
    super().__init__(command_executor=executor, options=options)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 250, in __init__
    self.start_session(capabilities)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 342, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
    self.error_handler.check_response(response)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 0

=> Scraper finished with an error.
Traceback (most recent call last):
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module>
    main()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 348, in main
    outreach.start()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/Outreach.py", line 186, in start
    items = self.get_items_from_file(output_path)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/Outreach.py", line 126, in get_items_from_file
    with open(file_name, "r", errors="ignore") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/g-besoin/Desktop/print/MoneyPrinterV2/.mp/scraper_results.csv'


Affiliate 

Traceback (most recent call last):
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module>
    main()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 338, in main
    afm = AffiliateMarketing(selected_product["affiliate_link"], account["firefox_profile"], account["id"], account["nickname"], account["topic"])
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/AFM.py", line 64, in __init__
    self.scrape_product_information()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/AFM.py", line 72, in scrape_product_information
    self.browser.get(self.affiliate_link)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 454, in get
    self.execute(Command.GET, {"url": url})
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
    self.error_handler.check_response(response)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: Malformed URL: URL constructor:  is not a valid URL.
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
InvalidArgumentError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:384:5
GeckoDriver.prototype.navigateTo@chrome://remote/content/marionette/driver.sys.mjs:1054:11

What Im I doing wrong ?

Image
Originally created by @zakblacki on GitHub (Jan 24, 2025). Original GitHub issue: https://github.com/FujiwaraChoki/MoneyPrinterV2/issues/90 Here is my config.json ``` `{ "verbose": true, "firefox_profile": "/Users/g-besoin/Library/Application Support/Firefox/Profiles/3ofmjrlf.default", "headless": false, "twitter_language": "English", "llm": "gpt4", "image_prompt_llm": "gpt4", "image_model": "v3", "threads": 3, "zip_url": "", "is_for_kids": false, "google_maps_scraper": "https://github.com/gosom/google-maps-scraper/archive/refs/tags/v1.7.5.zip", "email": { "smtp_server": "smtp.gmail.com", "smtp_port": 587, "username": "", "password": "" }, "google_maps_scraper_niche": "", "scraper_timeout": 300, "outreach_message_subject": "I have a question...", "outreach_message_body_file": "outreach_message.html", "assembly_ai_api_key": "XXXXXmyAPI", "font": "bold_font.ttf", "imagemagick_path": "/opt/homebrew/bin/convert" } ` ``` Here's the error log : ``` ℹ️ Starting YT Shorts Automater... +----+--------------------------------------+----------+---------+ | ID | UUID | Nickname | Niche | +----+--------------------------------------+----------+---------+ | 1 | 969d7784-0bfb-4c5a-b4e4-5c15244cee78 | zakblack | science | +----+--------------------------------------+----------+---------+ ❓ Select an account to start: 1 Traceback (most recent call last): File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module> main() File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 92, in main youtube = YouTube( File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/YouTube.py", line 83, in __init__ self.browser: webdriver.Firefox = webdriver.Firefox(service=self.service, options=self.options) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__ super().__init__(command_executor=executor, options=options) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 250, in __init__ self.start_session(capabilities) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 342, in start_session response = self.execute(Command.NEW_SESSION, caps)["value"] File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute self.error_handler.check_response(response) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 0 ℹ️ Starting Twitter Bot... +----+--------------------------------------+----------+---------------+ | ID | UUID | Nickname | Account Topic | +----+--------------------------------------+----------+---------------+ | 1 | fb3e2275-3f83-422a-93fc-28160d14fcce | zakblack | science | +----+--------------------------------------+----------+---------------+ ❓ Select an account to start: 1 Traceback (most recent call last): File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module> main() File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 212, in main twitter = Twitter(selected_account["id"], selected_account["nickname"], selected_account["firefox_profile"], selected_account["topic"]) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/Twitter.py", line 59, in __init__ self.browser: webdriver.Firefox = webdriver.Firefox(service=self.service, options=self.options) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__ super().__init__(command_executor=executor, options=options) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 250, in __init__ self.start_session(capabilities) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 342, in start_session response = self.execute(Command.NEW_SESSION, caps)["value"] File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute self.error_handler.check_response(response) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 0 => Scraper finished with an error. Traceback (most recent call last): File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module> main() File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 348, in main outreach.start() File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/Outreach.py", line 186, in start items = self.get_items_from_file(output_path) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/Outreach.py", line 126, in get_items_from_file with open(file_name, "r", errors="ignore") as f: FileNotFoundError: [Errno 2] No such file or directory: '/Users/g-besoin/Desktop/print/MoneyPrinterV2/.mp/scraper_results.csv' Affiliate Traceback (most recent call last): File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module> main() File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 338, in main afm = AffiliateMarketing(selected_product["affiliate_link"], account["firefox_profile"], account["id"], account["nickname"], account["topic"]) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/AFM.py", line 64, in __init__ self.scrape_product_information() File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/AFM.py", line 72, in scrape_product_information self.browser.get(self.affiliate_link) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 454, in get self.execute(Command.GET, {"url": url}) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute self.error_handler.check_response(response) File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.InvalidArgumentException: Message: Malformed URL: URL constructor: is not a valid URL. Stacktrace: RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8 WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5 InvalidArgumentError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:384:5 GeckoDriver.prototype.navigateTo@chrome://remote/content/marionette/driver.sys.mjs:1054:11 ``` What Im I doing wrong ? <img width="379" alt="Image" src="https://github.com/user-attachments/assets/79f53192-f5cf-4281-8b6b-a7959f9b340e" />
Author
Owner

@pinky969 commented on GitHub (Jan 31, 2025):

I am having the same issue

<!-- gh-comment-id:2626203422 --> @pinky969 commented on GitHub (Jan 31, 2025): I am having the same issue
Author
Owner

@paltaa commented on GitHub (Feb 9, 2025):

@zakblacki did you find a fix for this? same issue in macos

<!-- gh-comment-id:2646617098 --> @paltaa commented on GitHub (Feb 9, 2025): @zakblacki did you find a fix for this? same issue in macos
Author
Owner

@skp225 commented on GitHub (Feb 13, 2025):

Getting the same error AI is saying:

"This new error "WebDriverException: Process unexpectedly closed with status 0" typically occurs when:

The GeckoDriver executable is missing from the system PATH
There's a version mismatch between Firefox and Selenium
The browser fails to start due to incorrect options or profile configuration"

<!-- gh-comment-id:2657316212 --> @skp225 commented on GitHub (Feb 13, 2025): Getting the same error AI is saying: "This new error "WebDriverException: Process unexpectedly closed with status 0" typically occurs when: The GeckoDriver executable is missing from the system PATH There's a version mismatch between Firefox and Selenium The browser fails to start due to incorrect options or profile configuration"
Author
Owner

@wlnt360 commented on GitHub (Feb 14, 2025):

same issue on Mac M1

<!-- gh-comment-id:2658413716 --> @wlnt360 commented on GitHub (Feb 14, 2025): same issue on Mac M1
Author
Owner

@FujiwaraChoki commented on GitHub (Feb 15, 2025):

What Python version are you on?

<!-- gh-comment-id:2661107763 --> @FujiwaraChoki commented on GitHub (Feb 15, 2025): What Python version are you on?
Author
Owner

@houseofjuici commented on GitHub (Feb 16, 2025):

headless needs to be true , and youll need to tweak twitter script to accept headless . it should already have a variable for that. i just spent like 2 hours working through that. if anyone knows how to find the daggone tweet button that would be nice. i keep timing out or elemtn not found, prettty sure elon nerfed selenium

<!-- gh-comment-id:2661244574 --> @houseofjuici commented on GitHub (Feb 16, 2025): headless needs to be true , and youll need to tweak twitter script to accept headless . it should already have a variable for that. i just spent like 2 hours working through that. if anyone knows how to find the daggone tweet button that would be nice. i keep timing out or elemtn not found, prettty sure elon nerfed selenium
Author
Owner

@houseofjuici commented on GitHub (Feb 16, 2025):

also , youre gonna run into a topic issue when trying to post tweets at first, so make sure to set topic to niche , its set topic to topic and i cant get that to work but i got the former to work (i dont know what im doing just vibing and helpin out lol)

<!-- gh-comment-id:2661245023 --> @houseofjuici commented on GitHub (Feb 16, 2025): also , youre gonna run into a topic issue when trying to post tweets at first, so make sure to set topic to niche , its set topic to topic and i cant get that to work but i got the former to work (i dont know what im doing just vibing and helpin out lol)
Author
Owner

@houseofjuici commented on GitHub (Feb 16, 2025):

also change your set prefrence in all your scripts from the two lines to this

self.options.set_preference("profile", fp_profile_path)

<!-- gh-comment-id:2661246123 --> @houseofjuici commented on GitHub (Feb 16, 2025): also change your set prefrence in all your scripts from the two lines to this self.options.set_preference("profile", fp_profile_path)
Author
Owner

@ayan4m1 commented on GitHub (Feb 18, 2025):

@ragnorcap Change div to button in the XPath selector 😉

<!-- gh-comment-id:2664645914 --> @ayan4m1 commented on GitHub (Feb 18, 2025): @ragnorcap Change `div` to `button` in the XPath selector 😉
Author
Owner

@FujiwaraChoki commented on GitHub (Feb 18, 2025):

@ragnorcap Change div to button in the XPath selector 😉

Could you please make a PR?

<!-- gh-comment-id:2664958124 --> @FujiwaraChoki commented on GitHub (Feb 18, 2025): > [<img alt="" width="16" height="16" src="https://avatars.githubusercontent.com/u/172419658?v=4&amp;size=80">@ragnorcap](https://github.com/ragnorcap) Change `div` to `button` in the XPath selector 😉 Could you please make a PR?
Author
Owner

@ayan4m1 commented on GitHub (Feb 18, 2025):

@ragnorcap Change div to button in the XPath selector 😉

Could you please make a PR?

Sure, there are a few other fixes I have applied in trying to get things to work smoothly, I'll make a separate PR for those as well.

EDIT: #108 #109

<!-- gh-comment-id:2666213552 --> @ayan4m1 commented on GitHub (Feb 18, 2025): > > [<img alt="" width="16" height="16" src="https://avatars.githubusercontent.com/u/172419658?v=4&amp;size=80">@ragnorcap](https://github.com/ragnorcap) Change `div` to `button` in the XPath selector 😉 > > Could you please make a PR? Sure, there are a few other fixes I have applied in trying to get things to work smoothly, I'll make a separate PR for those as well. EDIT: #108 #109
Author
Owner

@FujiwaraChoki commented on GitHub (Feb 18, 2025):

Report if #108 fixes the issue please, thx

<!-- gh-comment-id:2666690392 --> @FujiwaraChoki commented on GitHub (Feb 18, 2025): Report if #108 fixes the issue please, thx
Author
Owner

@ayan4m1 commented on GitHub (Feb 19, 2025):

I think this is related to this issue, from geckodriver release notes

Known problems

    Startup hang with Firefox running in a container (e.g. snap, flatpak):

    When Firefox is packaged inside a container (like the default Firefox browser
    shipped with Ubuntu 22.04), it may see a different filesystem to the host.
    This can affect access to the generated profile directory, which may result
    in a hang when starting Firefox. Workarounds are listed in the geckodriver
    [usage documentation](https://firefox-source-docs.mozilla.org/testing/geckodriver/Usage.html#Running-Firefox-in-an-container-based-package).
<!-- gh-comment-id:2667394924 --> @ayan4m1 commented on GitHub (Feb 19, 2025): I think this is related to this issue, from geckodriver [release notes](https://github.com/mozilla/geckodriver/releases/tag/v0.35.0) ``` Known problems Startup hang with Firefox running in a container (e.g. snap, flatpak): When Firefox is packaged inside a container (like the default Firefox browser shipped with Ubuntu 22.04), it may see a different filesystem to the host. This can affect access to the generated profile directory, which may result in a hang when starting Firefox. Workarounds are listed in the geckodriver [usage documentation](https://firefox-source-docs.mozilla.org/testing/geckodriver/Usage.html#Running-Firefox-in-an-container-based-package). ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/MoneyPrinterV2#68
No description provided.