标签: instapy

收到错误“无法从‘emoji.unicode_codes’导入名称‘UNICODE_EMOJI’”

我正在尝试使用 InstaPy 创建一个 Instagram 机器人。我正在关注这个教程

当我跑步时:

from instapy import InstaPy

session = InstaPy(username="your username", password="your password")
session.login()
Run Code Online (Sandbox Code Playgroud)

我收到这个错误:

ImportError: cannot import name 'UNICODE_EMOJI' from 'emoji.unicode_codes' (C:\Users\roeegg22\AppData\Local\Programs\Python\Python310\lib\site-packages\emoji\unicode_codes\__init__.py)
Run Code Online (Sandbox Code Playgroud)

我在网上尝试了一些解决方案,但没有一个有效。

python instapy

12
推荐指数
1
解决办法
2万
查看次数

InstaPy:“错误,无法确定 64 位 linux 的正确文件名”

任何人都知道如何解决这个问题?来自控制台的堆栈跟踪,执行后报告错误:

    InstaPy Version: 0.6.9
    ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
    Workspace in use: "/home/zanettra/InstaPy"
    Error, unable to determine correct filename for 64bit linux
    Traceback (most recent call last):
    File "unfollow.py", line 24, in <module>
    headless_browser=False)
    File "/usr/local/lib/python3.6/dist-packages/instapy/instapy.py", line 
    322, in __init__
    self.logger,
      File "/usr/local/lib/python3.6/dist-packages/instapy/browser.py", line 114, in set_selenium_local_session
        driver_path = geckodriver_path or get_geckodriver()
      File "/usr/local/lib/python3.6/dist-packages/instapy/browser.py", line 36, in get_geckodriver
        sym_path = gdd.download_and_install()[1]
      File "/usr/local/lib/python3.6/dist-packages/webdriverdownloader/webdriverdownloader.py", line 177, in download_and_install
        show_progress_bar=show_progress_bar)
      File "/usr/local/lib/python3.6/dist-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download
        download_url = …
Run Code Online (Sandbox Code Playgroud)

python linux instapy

11
推荐指数
1
解决办法
6926
查看次数

如何克服 InstaPy 中的 cookie 问题?

我正在尝试学习在 InstaPy 上编码。

首先,我们开始使用 Selenium,效果很好。

然后,在安装 InstaPy 后,事情开始变得忙碌:显然,Instagram 的 cookie 不是通用的,并且从一个国家到另一个国家都会发生变化。因此,绕过 cookie 页面的代码以相同的方式处理不同的问题。这就是我收到此错误的原因:

未找到 Cookie 文件,正在创建 Cookie...

使用 InstaPy 登录后,我收到此“接受 cookies”页面,然后收到前面提到的此错误。如果我手动单击“全部接受”,它就会起作用并继续工作流程。

所以我这里的问题是如何绕过这个问题:我应该修改库中的代码吗?(说实话,我很难理解 InstaPy 类的整个编码。)

或者我应该尝试手动完成所有事情?

"""
This template is written by @loopypanda

What does this quickstart script aim to do?
- My settings is for running InstaPY 24/7 with approximately 1400
follows/day - 1400 unfollows/day running follow until reaches 7500 and than switch to unfollow until reaches 0.
"""

from instapy import InstaPy
from instapy import smart_run

# get a …
Run Code Online (Sandbox Code Playgroud)

python cookies selenium instagram instapy

5
推荐指数
0
解决办法
1400
查看次数

Instapy“无效的元素!”

我在运行时收到以下消息:

instapy: "Invalid Like Element!"
Run Code Online (Sandbox Code Playgroud)

我的代码是

from instapy import InstaPy

insta_username = 'username'
insta_password = 'password'


session = InstaPy(username=insta_username, password=insta_password)
session.login()

session.set_delimit_commenting(enabled=True, max_comments=50000, min_comments=0)
session.set_do_comment(enabled=True, percentage=50)
session.set_comments(['comment1', 'comment2'])

session.like_by_tags(['tag1','tag2'], amount=40)



session.end()
Run Code Online (Sandbox Code Playgroud)

我认为问题出在 InstaPy 的 xpath_compile.py 中。此时我的 xpath_compile 设置为:

`xpath["like_image"] = {
    "like": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button[*[local-name()='svg']/@aria-label='Like']",
    "unlike": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button[*[local-name()='svg']/@aria-label='Unlike']",
}`
Run Code Online (Sandbox Code Playgroud)

这里得到的错误

有任何想法吗?

python instapy

4
推荐指数
1
解决办法
910
查看次数

instabot 错误,为什么我会收到这些错误以及如何修复?

我写这个是为了将 10000 张照片上传到 Instagram,每小时一张,每当我运行它时,我都会收到这些错误

信息 - Instabot 版本:0.117.0 已开始

信息 - 尚未登录开始:预登录流程!

错误 - 请求返回 429 错误!

警告 - 这意味着“请求太多”。我去睡5分钟。

这是我的代码我做错了什么吗?有人可以指出并解释一下吗?

from instabot import Bot 导入时间

机器人=机器人()

图像 = 1

bot.login(用户名=“用户名”,密码=“密码”)

当图像 < 10000 时: photo = str(image) bot.upload_photo(f"{photo}.png") time.sleep(3600) image += 1

python instagram instapy

2
推荐指数
1
解决办法
8691
查看次数

“无法检测帖子媒体类型。跳过” InstaPy 机器人不与帖子互动

我正在尝试为 instapy 编写一个代码,以便通过标签对帖子进行点赞和评论。它显示标签页面但不与帖子交互。我的代码:

session = InstaPy(username, password)                               
session.login()                                                                          
session.set_relationship_bounds(enabled=True,max_followers=200)                          
session.set_do_follow(True,percentage=100)                                               
session.like_by_tags(["indiemusic", "heartbreakanniversary"], amount=5,interact=True)      
session.set_dont_like(["naked", "nsfw"])                                                 
session.set_do_follow(True, percentage=50)                                               
session.set_do_comment(True, percentage=50)                                              
session.set_comments(["Nice!", "S`weet!", "Beautiful :heart_eyes:"])                      
session.set_user_interact(amount=1,randomize=True,percentage=100)                        
session.end()                                                                                         
Run Code Online (Sandbox Code Playgroud)

python instapy

1
推荐指数
1
解决办法
4798
查看次数

标签 统计

instapy ×6

python ×6

instagram ×2

cookies ×1

linux ×1

selenium ×1