我正在尝试使用 instapy 创建一个 Instagram 机器人,但是我一直遇到这个错误。
这是我的代码:
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()
这是错误:
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'
我一直在寻找这个解决方案几个小时,但似乎没有人能够找到可行的解决方案。有谁知道如何解决这个问题吗?
问题是 Selenium 包删除了上一个版本中的
firefox_profile
参数。
4.9.0
还是支持的。