admin管理员组文章数量:1290956
I got this error:
from fake_useragent import UserAgent
File "D:\Kerja\HIT\Python Projects\Ongoing Projects\Andrew Mancilla\mancilla-env\lib\site-packages\fake_useragent\__init__.py", line 4, in <module>
from fake_useragent.fake import FakeUserAgent, UserAgent
File "D:\Kerja\HIT\Python Projects\Ongoing Projects\Andrew Mancilla\mancilla-env\lib\site-packages\fake_useragent\fake.py", line 8, in <module>
from fake_useragent.utils import BrowserUserAgentData, load
File "D:\Kerja\HIT\Python Projects\Ongoing Projects\Andrew Mancilla\mancilla-env\lib\site-packages\fake_useragent\utils.py", line 42, in <module>
def load() -> list[BrowserUserAgentData]:
TypeError: 'type' object is not subscriptable
How to remove that error?
My spec
scrape-fake-useragent==1.4.4
fake-useragent==2.0.0
Scrapy==2.11.2
Python 3.8
I got this error:
from fake_useragent import UserAgent
File "D:\Kerja\HIT\Python Projects\Ongoing Projects\Andrew Mancilla\mancilla-env\lib\site-packages\fake_useragent\__init__.py", line 4, in <module>
from fake_useragent.fake import FakeUserAgent, UserAgent
File "D:\Kerja\HIT\Python Projects\Ongoing Projects\Andrew Mancilla\mancilla-env\lib\site-packages\fake_useragent\fake.py", line 8, in <module>
from fake_useragent.utils import BrowserUserAgentData, load
File "D:\Kerja\HIT\Python Projects\Ongoing Projects\Andrew Mancilla\mancilla-env\lib\site-packages\fake_useragent\utils.py", line 42, in <module>
def load() -> list[BrowserUserAgentData]:
TypeError: 'type' object is not subscriptable
How to remove that error?
My spec
scrape-fake-useragent==1.4.4
fake-useragent==2.0.0
Scrapy==2.11.2
Python 3.8
Share
Improve this question
asked Feb 13 at 17:51
Aminah NurainiAminah Nuraini
19.2k9 gold badges97 silver badges113 bronze badges
1 Answer
Reset to default -1The error is caused by module fake-useragent==2.0.0
requires Python 3.9 while I still use Python 3.8. It's solved by downgrading it to fake-useragent==1.5.1
本文标签: pythonObject is not subscriptable in Scrapy Fake User AgentStack Overflow
版权声明:本文标题:python - Object is not subscriptable in Scrapy Fake User Agent - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741511518a2382636.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论