Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/334.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用IGRAMS进行身份验证时出现Unicode错误_Python_Web Scraping_Instagram_Instagram Api - Fatal编程技术网

Python 使用IGRAMS进行身份验证时出现Unicode错误

Python 使用IGRAMS进行身份验证时出现Unicode错误,python,web-scraping,instagram,instagram-api,Python,Web Scraping,Instagram,Instagram Api,我正在尝试使用igramscraper(Python)来刮取Instagram,但我在使用这个库时遇到了问题。 pip安装不起作用,所以我手动安装了库,但现在我在运行下面的脚本时遇到了一个unicode错误。 你知道如何解决这个问题吗?也许我做错了什么 from igramscraper.instagram import Instagram instagram = Instagram() # authentication supported instagram.

我正在尝试使用igramscraper(Python)来刮取Instagram,但我在使用这个库时遇到了问题。 pip安装不起作用,所以我手动安装了库,但现在我在运行下面的脚本时遇到了一个unicode错误。 你知道如何解决这个问题吗?也许我做错了什么


    from igramscraper.instagram import Instagram
    instagram = Instagram()
    # authentication supported
    instagram.with_credentials('username', 'password')


NameError回溯(最近一次呼叫上次)
在()
4.
5#支持身份验证
---->6 instagram。具有_凭据(“用户名”、“密码”)
7 instagram.login()
8.
~\AppData\Local\Continuum\anaconda3\lib\site packages\igramscraper\instagram.py,带有\u凭据(self、用户名、密码、会话\u文件夹)
66
67 Instagram.instance_cache=CookieSessionManager(
--->68会话_文件夹,slugify(用户名)+'.txt')
69
70其他:
slagify中的~\AppData\Local\Continuum\anaconda3\lib\site packages\slagify.py(字符串)
22
23返回re.sub(r'[-\s]+','-',
--->24 unicode(
25 re.sub(r'[^\w\s-],'',
26 unicodedata.normalize('NFKD',字符串)
名称错误:未定义名称“unicode”```

    NameError                                 Traceback (most recent call last)
    <ipython-input-48-a0f8512bd154> in <module>()
          4 
          5 # authentication supported
    ----> 6 instagram.with_credentials('username', 'password')
          7 instagram.login()
          8 
    
    ~\AppData\Local\Continuum\anaconda3\lib\site-packages\igramscraper\instagram.py in with_credentials(self, username, password, session_folder)
         66 
         67             Instagram.instance_cache = CookieSessionManager(
    ---> 68                 session_folder, slugify(username) + '.txt')
         69 
         70         else:
    
    ~\AppData\Local\Continuum\anaconda3\lib\site-packages\slugify.py in slugify(string)
         22 
         23     return re.sub(r'[-\s]+', '-',
    ---> 24             unicode(
         25                 re.sub(r'[^\w\s-]', '',
         26                     unicodedata.normalize('NFKD', string)
    
    NameError: name 'unicode' is not defined```