mirror of
https://github.com/FujiwaraChoki/MoneyPrinterV2.git
synced 2026-04-26 06:35:51 +03:00
[GH-ISSUE #100] about to crashout over this tweet button , cant get the PR fix to work either . #70
Labels
No labels
bug
enhancement
good first issue
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/MoneyPrinterV2#70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @houseofjuici on GitHub (Feb 16, 2025).
Original GitHub issue: https://github.com/FujiwaraChoki/MoneyPrinterV2/issues/100
ℹ️ => Fetching songs...
============ OPTIONS ============
=================================
Select an option: 2
ℹ️ Starting Twitter Bot...
+----+--------------------------------------+----------+-------------------+
| ID | UUID | Nickname | Account Topic |
+----+--------------------------------------+----------+-------------------+
| 1 | 4568db8e-8f05-4238-96d1-f0af9ebaff61 | rtts | music pop culture |
+----+--------------------------------------+----------+-------------------+
❓ Select an account to start: 1
============ OPTIONS ============
=================================
❓ Select an option: 1
ℹ️ Generating a post...
ℹ️ Length of post: 269
ℹ️ Generating a post...
ℹ️ Length of post: 225
=> Posting to Twitter: 🎶✨ The resurgence of 90s pop i...
Traceback (most recent call last):
File "/Users/acetwotimes/MoneyPrinterV2/src/classes/Twitter.py", line 83, in post
bot.find_element(By.XPATH, "//a[@data-testid='SideNav_NewTweet_Button']").click()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/anaconda3/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 888, in find_element
return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/anaconda3/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
self.error_handler.check_response(response)
File "/usr/local/anaconda3/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //a[@data-testid='SideNav_NewTweet_Button']; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:197:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:527:5
dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/acetwotimes/MoneyPrinterV2/src/main.py", line 438, in
main()
File "/Users/acetwotimes/MoneyPrinterV2/src/main.py", line 277, in main
twitter.post()
File "/Users/acetwotimes/MoneyPrinterV2/src/classes/Twitter.py", line 86, in post
bot.find_element(By.XPATH, "//a[@data-testid='SideNav_NewTweet_Button']").click()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/anaconda3/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 888, in find_element
return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/anaconda3/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
self.error_handler.check_response(response)
File "/usr/local/anaconda3/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //a[@data-testid='SideNav_NewTweet_Button']; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:197:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:527:5
dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16
##########################################################################
❓ Select an option: 3
+----+----------------------+-------------------------------------------------------------------+
| ID | Date | Content |
+----+----------------------+-------------------------------------------------------------------+
| 1 | 02/16/2025, 03:04:45 | 🎶✨ The resurgence of 90s pop icons in today's music scene is... |
+----+----------------------+-------------------------------------------------------------------+
============ OPTIONS ============
=================================
❓ Select an option: 1
ℹ️ Generating a post...
ℹ️ Length of post: 208
=> Preparing to post on Twitter: 🎶✨ The resurgence of 90s pop i...
Failed to find the text box element.
Tweet content (printed to terminal):
🎶✨ The resurgence of 90s pop icons in today's music scene is a nostalgic treat for fans! From remixes to surprise collaborations, it's a reminder that great music never truly fades away. #90sPop #MusicRevival
x#########################################################################
so i can generate but not type or find the buttons or boxes, even tried flipping the cod so i can type first...didnt work either . any suggestions? ive been stuck on this part for a imnute, and ive done all the fixes ive found so far including using css selector . i get nada.
twitter.py code
import re
import g4f
import sys
import os
import json
from cache import *
from config import *
from status import *
from constants import *
from typing import List
from datetime import datetime
from termcolor import colored
from selenium_firefox import *
from selenium import webdriver
from selenium.common import exceptions
from selenium.webdriver.common import keys
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.options import Options
from webdriver_manager.firefox import GeckoDriverManager
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
Import joblib for parallel processing
from joblib import Parallel, delayed
class Twitter:
"""
Class for the Bot that grows a Twitter account.
"""
def init(self, account_uuid: str, account_nickname: str, fp_profile_path: str, topic: str) -> None:
"""
Initializes the Twitter Bot.
@FujiwaraChoki commented on GitHub (Feb 16, 2025):
Brother, for the love of God, reduce the amount of Text I have to read!
@houseofjuici commented on GitHub (Feb 16, 2025):
lol my bad, but im having issues finding the element . i can generate but cant find the boxes or buttons .
this doesnt work on my end for some reason, likely somthing im doing , ive tried plenty of other combos, went to read documentation and tried what the one guy put in the PR.
@farukhsk09 commented on GitHub (Feb 18, 2025):
is it because the element is addButton ??