抓取媒体、喜好、关注者、标签和所有元数据

igramscraper的Python项目详细描述


Instagram_刮刀

这是一个用python编写的极简instagram scraper。

它可以获取媒体、帐户、视频、评论等。 `还支持“comment”和“like”操作。

要获得Instagram API的应用程序批准并不容易,因此我在instagram-php-scraper的启发下创建了这个工具。

这个项目的目标是成为尽可能简约,同时仍然有所有需要的功能,以便它很容易添加代码到它!

如果您喜欢这个项目,任何或贡献都将不胜感激

如何安装

只需运行:

pip install igramscraper

或者通过git clone下载项目并运行以下命令:

pip install -r requirements.txt

用法

某些方法确实需要验证:

fromigramscraper.instagramimportInstagraminstagram=Instagram()# authentication supportedinstagram.with_credentials('username','password')instagram.login()#Getting an account by idaccount=instagram.get_account_by_id(3)# Available fieldsprint('Account info:')print('Id: ',account.identifier)print('Username: ',account.username)print('Full name: ',account.full_name)print('Biography: ',account.biography)print('Profile pic url: ',account.get_profile_pic_url_hd())print('External Url: ',account.external_url)print('Number of published posts: ',account.media_count)print('Number of followers: ',account.followed_by_count)print('Number of follows: ',account.follows_count)print('Is private: ',account.is_private)print('Is verified: ',account.is_verified)# or simply for printing use print(account)

如果使用身份验证,程序将在默认情况下缓存用户会话,因此不需要每次都创建会话。
如果要禁用用户会话缓存,请将True分配给instagram.login()方法

通过cli接口还支持双因素身份验证,只需对login()函数的第二个参数使用'true'。

许多方法不需要身份验证

有关详细信息,请浏览示例文件夹

对请求使用代理:

fromigramscraper.instagramimportInstagramproxies={'http':'http://123.45.67.8:1087','https':'http://123.45.67.8:1087',}instagram=Instagram()instagram.set_proxies(proxies)account=instagram.get_account('kevin')print(account.identifier)

更多用法

参见示例here

如何贡献

欢迎您的任何贡献,查看我们的TODOs
加入我们的电报组:https://t.me/joinchat/J86yTBAtZlEi-6T6LOxijw

其他

instagram php刮刀here

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
用户界面如何在JavaGUI中为按钮创建各种颜色?   使用MSCAPI的RSA密钥包装的java使用   java Spring数据Redis JedisConnectionException:意外的流结束   java饼图未显示预期输出   java hystrixCommand注释commandKey的用途是什么   windows java可以从cmd运行jar,但不能通过双击来运行   java在单击按钮时遍历XML节点   java试图使用日期(int,int,int)构造函数   带有Buildship 2子项目的java不作为项目依赖项链接   java jsonrpc4j:如何从服务器获取列表<SomeObject>?   用于Java应用程序的内存设置MaxDirectMemory和MaxHeapMemory   java如何从以下类型格式化日期   javayoutube。搜索列表搜索不返回任何内容   java My参数在方法中不起作用,因为泛型存在问题   java如何将Map<Key1Type,Val1Type>转换为Map<Key1Type,Val2Type>   JavaJUnit测试:测试用例的改进,测试数组列表的长度?   java如何在Android中解析带有属性值的xml数据?   使用Hibernate对枚举类型进行Java8bean验证