xacnio/tweetcapture

Chromedriver executable path

Closed this issue · 6 comments

Hi,

selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Wanted to apply the fix with this [https://stackoverflow.com/questions/29858752/error-message-chromedriver-executable-needs-to-be-available-in-the-path]

P.S. Thx for adding the example IG. Will try to submit other PRs for examples

1- Go to https://sites.google.com/a/chromium.org/chromedriver/home
2- Click latest stable release
3- Download win32 or use another version for your operating system.
4- Copy chromedriver.exe or chromedriver executable file to suitable path. if you use Windows, default path is C:/bin/chromedriver.exe. Else default path is /usr/local/bin/chromedriver.

You can change chromedriver path with set_chromedriver_path in code.

from tweetcapture import TweetCapture
import asyncio
tweet = TweetCapture()


tweet.set_chromedriver_path("/usr/bin/chromedriver")


asyncio.run(tweet.screenshot(
    "https://mobile.twitter.com/jack/status/20", "test1.png", mode=3, night_mode=2))

Thx for the quick responses :)

Still doesn't work.

image

I've downloaded the right version of ChromeDriver added to both the main folder of the script and tweetcapture folder. I also added it to PATH in windows - still doesn't work.

From the StackOverflow post it seems the only workaround is the webdriver manager.

Also in Windows there is no C:/bin, I think that's in in Linux. And where are you using set_chromedriver_path

Make sure you have the latest version of Google Chrome installed. Chromedriver needs Google Chrome.

C:/bin/chromedriver.exe is default path for this program. Windows doesn't have it. Create folder C:/bin and copy chromedriver.exe to the folder. If you will use default path, don't use set_chromedriver_path in your code.

If you won't use default path, use set_chromedriver_path in your code and define custom path. But be careful when using slashes. C:\Users\user\chromedriver.exe is incorrect. Use / or \\ as slashes.
e.g.
C:\\Users\\user\\chromedriver.exe
C:/Users/user/chromedriver.exe

Dude. That worked!!!!!

It's like you're a magician :)

Thx.

Saw the screenshot:

a) how do I run the tweet screenshot to Instagram to post the screenshot to IG?
b) how do I make this run for EVERY new tweet OR tweets of certain accounts (based on keywords) to screenshot (and then post to IG)? Sort of like a cron function that checks for x criteria, takes screenshot..

I cd into the examples to run the insta script tho it is posting the generic jack tweet.

Back to the previous comment, how to connect this to another tweet URL and for every new tweet (based on.)...

Thx

a) Added example about this: tweet_screenshot_to_instagram.py It's working. You can develop this example for more.

b) tweetcapture module is only simple screenshot tool. You can use different modules or Twitter API for your other processes from screenshot. Your issue must be about tweetcapture. Sorry, i can't help you about irrelevant questions here. You can search answer from Google or go to stackoverflow and another help platforms for your development questions.