【发布时间】:2021-09-06 08:08:27
【问题描述】:
我不是编码员,这是我第一次尝试编码。
我按照 YouTube 上的一些说明使用 Python 和 InstaPy 创建自动化。
.py文件的代码如下
from instapy import InstaPy
from instapy import smart_run
my_username = 'myuser'
my_password = 'mypassword'
session = InstaPy(username=my_username,
password=my_password,
headless_browser=True)
with smart_run(session):
`session.set_relationship_bounds(enable=True,`
delimit_by_numbers=True,
max_followers=600,
min_followers=30,
max_following=600)
`session.like_by_tags(['tag1', 'tag2', 'tag3', 'tag4'], amount=300)`
headless_browser=True 因为我想为我拥有的不同帐户运行多个自动机。
至少,根据教程,我认为这是正确的方法。
使用终端,访问文件所在桌面上的文件夹我运行命令 python3 test.py
我遇到了一个巨大的错误。
我已经在 GtHub 上看过一些关于 mac 上的错误的帖子
https://github.com/timgrossmann/InstaPy/issues/5672
我已经按照那里的说明进行操作,但我仍然收到此错误:
InstaPy Version: 0.6.13
._. ._. ._. ._. ._. ._. ._. ._.
Workspace in use: "/Users/av/InstaPy"
Error, unable to determine correct filename for 64bit macos
Traceback (most recent call last):
File "/Users/av/Desktop/InstaAuto/test.py", line 7, in <module>
session = InstaPy(username=my_username,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/instapy/instapy.py", line 325, in __init__
self.browser, err_msg = set_selenium_local_session(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/instapy/browser.py", line 122, in set_selenium_local_session
driver_path = geckodriver_path or get_geckodriver()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/instapy/browser.py", line 38, in get_geckodriver
sym_path = gdd.download_and_install()[1]
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/webdriverdownloader/webdriverdownloader.py", line 174, in download_and_install
filename_with_path = self.download(version,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download
download_url = self.get_download_url(version, os_name=os_name, bitness=bitness)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/webdriverdownloader/webdriverdownloader.py", line 324, in get_download_url
raise RuntimeError(info_message)
RuntimeError: Error, unable to determine correct filename for 64bit macos
AVs-MacBook-Pro:InstaAuto av$
谁能帮我理解我应该怎么做?
非常感谢您抽出宝贵时间。
【问题讨论】:
-
能否正确格式化代码?它没有任何缩进,而且每两行都是空行,因此难以阅读。
-
尝试安装 geckodriver:
brew install geckodriver -
“我不是程序员,这是我第一次尝试编写代码。”然后,您应该遵循语言本身的教程并学习基础知识,然后再尝试将库用于某些特殊用途并输入一堆您不理解的代码。
标签: python python-3.x macos