InstaBot
InstaBot is a Python library that provides some automation for simple tasks on Instagram like following accounts and sending DMs on Instagram using Selenium. Please note that this library is not associated with Instagram or Meta.
Installation
You can install the library from the GitHub repository or by using pip:
pip install InstaWebBot
Usage
IMPORTANT (version older than 0.3.0): The driver file for Selenium must be located in the current working directory of your project. You can download the driver here. Please provide the driver name if you are not using the recommended geckodriver.
Initialize the bot by passing in your Instagram username and password as parameters:
from InstaWebBot import InstaBot
bot = InstaBot('your_username', 'your_password')
# A bot login is required before any other action will be executed.
bot.login()
Here is an example with some optional arguments (using their default value if default exists):
from InstaWebBot import InstaBot
bot = InstaBot('your_username', 'your_password',
driver="geckodriver",
output=False,
time=2.5)
To log in to Instagram with the given username and password use
bot.login()
Once you have created an instance of the InstaBot class, you can use its methods to automate some simple tasks on Instagram.
Functions
Search for a username by using
bot.search(query)
After that you can perform various actions on a user profile:
bot.follow()
bot.unfollow()
bot.send_dm(message)
bot.get_followers()
bot.get_picture(number)
bot.get_likes()
bot.get_liked_by()
bot.like_picture()
bot.write_comment(message)
It is also possible to get data from the profile once it has been searched with bot.search(query):
user_data = bot.get_data('instagram')
# user_data contains various counters as well as a link to the profile picture, homepage and bio
print(f"Follower count of @instagram: {user_data['followers']}")
This is a small example program to get 50 followers of a given profile (50 is the maximum amount, because Instagram limits the visibility of followers/following lists):
from InstaWebBot import InstaBot
bot = InstaBot('username', 'password')
bot.login()
bot.search('instagram')
followers = bot.get_followers()
for follower in followers:
print(follower)
bot.close()
Future functionality:
- Get follower and following counter
- Get post counter
- Allow commenting on posts
- Send direct messages to user
- Like different images than just the first image
- Download images
- Update
.get_data()function - Improve general usability
LICENSE
InstaBot is licensed under the GNU General Public License v2.0.
Help & Contribution
If you find an error please feel free to open an issue here.
Metadata
Release files for InstaWebBot 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| InstaWebBot-0.3.0.tar.gz | 15.3 kB | Without provenance | Details for InstaWebBot-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| InstaWebBot-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for InstaWebBot-0.3.0-py3-none-any.whl |
Total release size: 29.8 kB
Release files / InstaWebBot-0.3.0.tar.gz
| Download URL | InstaWebBot-0.3.0.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da5cec765930ab5b581c29400f3cc3f0994f0073fb4b4b6950bbb69761bac6bd
|
|
BLAKE2b-256 checksum How to use checksums |
9b3653fd52189fb865ea8cb0287521c61fcda672a93923a6022d0ea2b2039596
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Release files / InstaWebBot-0.3.0-py3-none-any.whl
| Download URL | InstaWebBot-0.3.0-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08c44672d8385117c032ebbcb8a88c34c48d109d51326516c73f0625ea917a53
|
|
BLAKE2b-256 checksum How to use checksums |
6e538e24f8a34c38aba26b4f5524e1206b32c9dd4abefd3a6bd10c9d393f9ec2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Security for InstaWebBot 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.