twitter-scraper-selenium
twitter-scraper-selenium copied to clipboard
AttributeError: 'str' object has no attribute 'close'
Running on my VPS: Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-52-generic x86_64)
[WDM] - Driver [/root/.wdm/drivers/geckodriver/linux64/v0.32.2/geckodriver] found in cache
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/twitter_scraper_selenium/profile.py", line 118, in scrap
self.__start_driver()
File "/usr/local/lib/python3.10/dist-packages/twitter_scraper_selenium/profile.py", line 40, in __start_driver
self.browser, self.headless, self.proxy, self.browser_profile).init()
File "/usr/local/lib/python3.10/dist-packages/twitter_scraper_selenium/driver_initialization.py", line 104, in init
driver = self.set_driver_for_browser(self.browser_name)
File "/usr/local/lib/python3.10/dist-packages/twitter_scraper_selenium/driver_initialization.py", line 97, in set_driver_for_browser
return webdriver.Firefox(service=FirefoxService(executable_path=GeckoDriverManager().install()), options=self.set_properties(browser_option))
File "/usr/local/lib/python3.10/dist-packages/seleniumwire/webdriver.py", line 179, in __init__
super().__init__(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/firefox/webdriver.py", line 197, in __init__
super().__init__(command_executor=executor, options=options, keep_alive=True)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 288, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 381, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 444, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py", line 249, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/crypto-ordinals/twitter_feeds.py", line 67, in <module>
tweets = scrape_profile(twitter_username="ordswapbot",output_format="json",browser="firefox",tweets_count=10,headless=False)
File "/usr/local/lib/python3.10/dist-packages/twitter_scraper_selenium/profile.py", line 197, in scrape_profile
data = profile_bot.scrap()
File "/usr/local/lib/python3.10/dist-packages/twitter_scraper_selenium/profile.py", line 128, in scrap
self.__close_driver()
File "/usr/local/lib/python3.10/dist-packages/twitter_scraper_selenium/profile.py", line 43, in __close_driver
self.__driver.close()
AttributeError: 'str' object has no attribute 'close'
same issue, any luck fixing it?
Have you installed the browser you use? Chrome or Firefox?
Did you manage to fix this? Facing the same issue. Firefox and geckodriver are present. Running on Ubuntu on a Digital Ocean droplet.
I had the same problem with Chrome on Ubuntu 22.04. The standard Firefox installation didn't work either, but I got FF to work after installing as .deb (see here)
@MoodPatterns can you share what's the version of Chrome that you were using?
@shaikhsajid1111 Version 117.0.5938.149 (Official Build) (64-bit)
any fixes? I'm running into the same issue
same error
i ran into the same issue ..
ran into the same issue