【问题标题】:Instagram Scraper cant connect to instagramInstagram Scraper 无法连接到 Instagram
【发布时间】:2023-02-08 15:31:32
【问题描述】:
JSON Query to accounts/login/: HTTPSConnectionPool(host='www.instagram.com', port=443): Max retries exceeded with url: /accounts/login/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)'))) [retrying; skip with ^C]

这是我尝试通过代理连接到 instagram 时收到的错误消息。 我的帐户/IP 被阻止过一次,但我更改了它,这部分错误当时有所不同:

(Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)'))) [retrying; skip with ^C]

我的功能:

def get_follower_list(arg_login_name, arg_login_password, arg_account_name, result_file, proxies):
    try:
        loader = instaloader.Instaloader()
        loader.login(arg_login_name, arg_login_password, proxies=proxies)
        profile = instaloader.Profile.from_username(loader.context, arg_account_name)
        file = open(os.path.join(sys.path[0], result_file), "w")
        file.write(f"Username: {profile.username}\n")
        file.write(f"User ID : {profile.userid}\n")
        file.write(f"Follower count: {profile.followers}\n")
        input(f"user {profile.username} has {profile.followers} followers!\n Press ENTER to start scraping\n"
              f"(you can exit anytime if you have enough by using strg + c!)")
        count = 0
        for followers in profile.get_followers():
            count = count + 1
            username = followers.username
            userlink = f"https://www.instagram.com/{username}"
            file.write(f"[{count}][FOLLOWER] - {userlink}\n")
            #print(f"[{count}][FOLLOWER] - {userlink}")

        file.close()
        print(f"\nFinished scraping! Saved data to {result_file}!")
    except ConnectionException:
        exit("\n\n\n---ERROR---\nIP might be blocked\nTry to restart program\nor use different proxy/bot account")
    except ProxyError:
        exit("\n\n\n---ERROR---\nConnection to proxy failed\nTry to restart program\nor check if the "
             "proxycredentials file is setup correctly!")

【问题讨论】:

    标签: python web-scraping instagram


    【解决方案1】:

    任何解决方案?有同样的错误

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-02
      相关资源
      最近更新 更多