ekozkan / twauto Goto Github PK
View Code? Open in Web Editor NEWtwAuto is a Python library for "Tweeting", "Retweeting", "Replying", "Tweet Quoting", "Tweet Liking" without any API requirements using Selenium.
License: MIT License
twAuto is a Python library for "Tweeting", "Retweeting", "Replying", "Tweet Quoting", "Tweet Liking" without any API requirements using Selenium.
License: MIT License
twAuto Error: Message: Service /data/user/0/ru.iiec.pydroid3/app_HOME/.wdm/drivers/chromedriver/linux64/114.0.5735.90/chromedriver unexpectedly exited. Status code was: 1
Hello there,
I've been using twAuto for some months now and It was working perfectly, however I'm bumping my head against a wall since I reainstalled my OS (W10 2H22)
Basically since 3 days ago I'm getting this same error:
C:\Users\TwitterCookies>py cookiecreator.py
Traceback (most recent call last):
File "C:\Users...\cookiecreator.py", line 13, in
tw.manualCookieCreation()
File "C:\Users...\Python311\Lib\site-packages\twAuto\twauto.py", line 145, in manualCookieCreation
twAuto.driver.get("https://twitter.com/login")
^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
I have tried to run it in other devices, same thing,
tried uninstalling and reinstalling several different versions of python, chrome and chromedrivers, same with selenium and the other dependencies. I'm out of ideas, even checked all the posible solutions chatGPT offered and unsurprisingly didn't changed a thing in the end results.
AttributeError: 'NoneType' object has no attribute 'get'
my twAuto version is the latest
Chrome is up to date
Version 114.0.5735.134 (Official Build) (64-bit)
Python 3.11 (64-bit)
I'm out of ideas. Tried in Linux Ubuntu 22.04.2 too, same error.
AttributeError: 'NoneType' object has no attribute 'get'
Tried this on linux and can tweet text ok, but if I try to also tweet an image it gives me this error:
twAuto Error: Message: element click intercepted: Element <div role="button" tabindex="0" class="css-18t94o4 css-1dbjc4n r-l5o3uw r-42olwf r-sdzlij r-1phboty r-rs99b7 r-19u6a5r r-2yi16 r-1qi8awa r-1ny4l3l r-ymttw5 r-o7ynqc r-6416eg r-lrvibr" data-testid="tweetButton">...</div> is not clickable at point (871, 818). Other element would receive the click: <div class="css-1dbjc4n r-1p0dtai r-1d2f490 r-1xcajam r-zchlnj r-ipm5af"></div>
(Session info: chrome=110.0.5481.177)
When I try with headless = False I can see the image has been uploaded into the page but it seems to fail at the last step of pressing the tweet button. Any idea what could be causing this?
the error :"//*[@id='layers']/div/div/div/div/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div[1]/div/div/div[3]/div/label/div/div[2]/div[1]/input"
is it because the twitter login page changed?
my code below:
tw = twAuto.twAuto(...
chromeDriverMode="auto",
driverPath=...,
pathType="testId",
headless=True,
debugMode= True)
tw.start()
Hey ! Thank you so much for making this client ! This will help me circumvent the Twitter API ban and keep my bot alive :)
I played a bit with it in order to make it work on Linux and tweak it to my needs.
One things noticed is that some selectors are not working properly : unfortunately, Twitter has a habit of breaking their dom structure and class ids. I suggest you use selectors based on the data-testid
field, which is pretty reliable in the long term, you should be able to avoid most breaking changes with it. Example :
body_element = container_element.find_element(XPATH, './/div[3]/div[7]/div/div[2]/div')
became
body_element = container_element.find_element(XPATH, '//*[@data-testid="retweet"]')
Don't know if this is related to this change, but body_element.click()
would not work afterward, so I used twAuto.driver.execute_script("arguments[0].click()", body_element)
instead.
Glad I found your project ! Thanks again for your work :)
tw.reply(url=
dont work only open page and close it
tryed to add sleep time but didnt work
So there's a known issue where the ChromeDriver isn't able to send emojis via keys.
The workaround is to either use the Firefox driver instead...
Or better yet, someone came up with a solution to copy the emoji text to the clipboard and then paste it into the field while still using Chrome. Below is the SO link with the sample code. I think it would be really useful to implement into twAuto ๐
Describe the bug
an outdated import of chromeType from core.utils. it has been changed to webdriver_manager.core.os_manager
To Reproduce
follow the basic example using selenium 4+
Additional context
webdriver_manager
related issue : SergeyPirogov/webdriver_manager#563
I always have my chromedriver.exe in a single location on my server for multiple applications to use the same executable. It would be helpful to add an extra config to allow us to specify a path to it instead of forcing to place it in the same dir as the script. ๐
Hello, Is this project open to contributions? If so how would you like this done.
Thank you
Hello,
First, here is my code:
python
Copier le code
import twAuto
tw = twAuto.twAuto(
username="",
email="",
password="",
chromeDriverMode="manual",
driverPath="chromedriver.exe",
pathType="xPath",
headless=False,
debugMode=True,
createCookies=False
)
tw.start()
tw.login()
print("Logged in")
tw.like(url="https://x.com/elonmusk/status/1809251925306777944")
print("Retweeted")
tw.close()
I can log in successfully using the tw.manualCookieCreation() function. However, when I launch the code with headless=False, I see that it logs in correctly, navigates to the tweet page, and then nothing happens.
Here is the output when I close the window:
less
Copier le code
twAuto started.
Starting twAuto...
Using Chrome Driver from the path: chromedriver.exe
Successfully Logged In
Logged in
twAuto Error: Message: no such window: target window already closed
from unknown error: web view not found
(Session info: chrome=126.0.6478.127)
Stacktrace:
GetHandleVerifier [0x00007FF61B24EEA2+31554]
(No symbol) [0x00007FF61B1C7ED9]
(No symbol) [0x00007FF61B08872A]
(No symbol) [0x00007FF61B05D995]
(No symbol) [0x00007FF61B1044D7]
(No symbol) [0x00007FF61B11C051]
(No symbol) [0x00007FF61B0FCDD3]
(No symbol) [0x00007FF61B0CA33B]
(No symbol) [0x00007FF61B0CAED1]
GetHandleVerifier [0x00007FF61B558B1D+3217341]
GetHandleVerifier [0x00007FF61B5A5AE3+3532675]
GetHandleVerifier [0x00007FF61B59B0E0+3489152]
GetHandleVerifier [0x00007FF61B2FE776+750614]
(No symbol) [0x00007FF61B1D375F]
(No symbol) [0x00007FF61B1CEB14]
(No symbol) [0x00007FF61B1CECA2]
(No symbol) [0x00007FF61B1BE16F]
BaseThreadInitThunk [0x00007FFE0C88257D+29]
RtlUserThreadStart [0x00007FFE0E10AF28+40]
Retweeted
Do you know what could be causing this issue?
Thank you for your help!
I couldn't be able to recreate this bug, so I don't know what is causing it right now, but if you encounter this problem, please check the manualCookieCreation function first, it will probably fix the problem for now.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.