Code Monkey home page Code Monkey logo

instagram-bot's Introduction

instagram-bot

Instagram bot built with Python 3.7 and the Selenium package.

Testing

  • 3/19/2019 with Google Chrome v72 and Python 3.7

Current Features

  • Follow a user
  • Unfollow a user
  • Search posts by tag
  • Like a users latest posts
  • Unlike a users latest posts
  • Download a users image media

Instructions for Use

  • Download driver for your respective version of Google Chrome into the root directory of the project. To see your Google Chrome version, go to chrome://version/ in your browser. To download the respective driver, go here: http://chromedriver.chromium.org/downloads.
  • Change the name of the file named config_.ini to config.ini, and add the username and password values in the config.ini file that the Instagram account the bot will use. Username and password combinations can also be passed when creating instances of the InstaBot class in instagram_bot.py.
  • Install the dependencies in requirements.txt, with pip install -r requirements.txt from the root directory of the project, preferably in a Python 3.7 virtual environment.
  • In the instagram_bot.py file, add the lines for the functionality desired at the bottom of the file.

instagram-bot's People

Contributors

dependabot[bot] avatar jg-fisher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

instagram-bot's Issues

Key error

Thanks for the public code and the video on youtube.

I'm having a 'key error' and don't know how to fix. Please help me with this.
'''

File "c:\Users\mauri\Documents\Instabot\Instagram-bot\bot.py", line 53, in
username = cparcer['AUTH']['USERNAME']
File "C:\Program Files\Python37\lib\configparser.py", line 958, in getitem
raise KeyError(key)
KeyError: 'AUTH'

'''

key_error

Liking comments issue

Im trying to figure out how to separate the like button from the comments-like-buttons!
If a post is already liked the bot goes on and likes the first comment (if there is one)!
Is there a way using selenium to use multiple css selectors?
E.g.
svg[aria-label="Like"][height="24"] for example? (The bot searches only for the big like button)

session not created (Chrome driver)

Need help with understanding the issue

While running the instagram_bot.py

DevTools listening on ws://127.0.0.1:58108/devtools/browser/976a1b1e-f170-4fb5-9183-94beb8ddc82b
Traceback (most recent call last):
File "instagram_bot.py", line 249, in
bot = InstaBot()
File "instagram_bot.py", line 34, in init
self.driver = webdriver.Chrome(config['ENVIRONMENT']['CHROMEDRIVER_PATH'])
File "F:\Learning Projects\instagram-bot-master\venv\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in init
RemoteWebDriver.init(
File "F:\Learning Projects\instagram-bot-master\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "F:\Learning Projects\instagram-bot-master\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "F:\Learning Projects\instagram-bot-master\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "F:\Learning Projects\instagram-bot-master\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 84

Cannot find the button

Hi ,

i just downloaded the code and run the instagram_bot.py file.
But in the end it says that

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="react-root"]/section/main/div/article/div/div[1]/div/form/div[3]"}

Can someone help me pls :-)

Greetz Kristof

Non "authorization"

Hi i write my login or password on config.ini file.
But if i start the program this i isn't see this.
What now???
Michael.
PS: i have instagram with facebook

img.get_attribute('src') what it does

issue

thanks for making this instagram bot public first of all.
i was trying to understand it through your code and video on youtube but got stuck on LINE 136
REGARDING img.get_attribute('src')
where does img came from and it how access the get_attribute('src') function
would be a great help if you could help me with this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.