0

I'm trying to create a instagram bot using instapy however I keep runnning into this error.

This is my code:

from instapy import InstaPy

session = InstaPy(username = "username", password = "password")
session.login()

session.set_relationship_bounds(enabled = True, max_followers = 1000)

session.set_do_follow(True, percentage=100)
session.like_by_tags(["clothingbrand","clothing","fashion"], amount = 3)
session.set_dont_like(["nsfw"])


session.end()

And this is the error:

Workspace in use: "C:/Users/1/InstaPy"
Traceback (most recent call last):
 File "C:\Instagram\instagram_bot.py", line 3, in <module>
session = InstaPy(username = "username", password = "password")
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\1\AppData\Local\Programs\Python\Python311\Lib\site-packages\instapy\instapy.py", line 330, in __init__
self.browser, err_msg = set_selenium_local_session(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\1\AppData\Local\Programs\Python\Python311\Lib\site-packages\instapy\browser.py", line 123, in set_selenium_local_session
browser = webdriver.Firefox(
          ^^^^^^^^^^^^^^^^^^
TypeError: WebDriver.__init__() got an unexpected keyword argument 'firefox_profile'

I've been looking for this solution for hours however nobody has seemed to be able to find a viable solution. Does anyone know how to fix this?

  • If you can update the question with how Selenium is initialized in _`instapy.py`_ I will try to construct an answer. – undetected Selenium Aug 03 '23 at 22:33
  • 1
    The arguments to `WebDriver()` changed in a recent upgrade of Selenium. I suspect InstaPy is written for the old version. – Barmar Aug 03 '23 at 22:36

1 Answers1

0

The problem is that Selenium package removed the firefox_profile argument in the last release. The 4.9.0 still support it.