Coder Social home page Coder Social logo

estayparadox / insta-bot Goto Github PK

View Code? Open in Web Editor NEW
185.0 185.0 47.0 1.65 MB

Python bot using Selenium increasing Instagram Followers.

License: MIT License

Python 100.00%
bot chromedriver codeclimate firefoxdriver followers instabot instagram instagram-followers selenium

insta-bot's Introduction

GitHub GitHub top language Maintainability GitHub issues GitHub contributors GitHub last commit (branch)

Insta-Bot

An Instagram Bot developed in Python with Selenium which uses the follow back principle to bring you followers gradually.

Increase your Instagram followers gradually

This bot is made to build an audience. It's not a bot that will directly bring you thousands of followers but maybe dozens of them every days. The principle is simple, the bot will search, thanks to a list of defined tags, for random posts on Instagram. For each post, the bot will like, comment and follow the author. As with Twitter, many users often follow the people who follow them. This bot therefore works on the « follow back » principle.

image1 image2 image3

How to use InstaBot

1. Prerequisites

To be able to run this little bot, you’ll need to have:

  • Python
  • Selenium
  • Chromedriver or Geckodriver
  • Google Chrome (English version) or Mozilla Firefox

Install Python

If you don't have python installed, follow this link and download the latest version of python. Then you can check if your version of python using the command lines bellow

python3 --version
pip3 --version

Install Selenium

Then you need to install selenium using pip

pip3 install selenium

Install you driver

Depending of the browser you use, install Chromedriver or Geckodriver and put the binary file in the src/ folder.

2. Configuration

These two lines are designed to authenticate you on Instagram. Basically change your_username and your_password to your Instagram credentials in the src/start.py file.

account_name="your_username"
account_password="your_password"

This is the hashtags your bot will reach to find random posts and persons to comment / like / follow. Change this line with your custom tags, here I’m using trip, dronephotography and traveler tags.

hashtag_list = ['trip', 'dronephotography', 'traveler']

4. Install all libraries

You can install all the libraries and modules used in this project using the below command.

pip3 install -r src/requirements.txt  

3. Run

Once the configuration is complete, it's time to run this bot. Simply run the command line below in a terminal:

python3 src/start.py

insta-bot's People

Contributors

estayparadox avatar mousakhani avatar nitinkumar30 avatar tlewap 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

insta-bot's Issues

Chrome dirver

it says

Message: 'chrome driver' executable needs to be in PATH.

Can I have some help pls

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[2]/div/div/div[3]/div/div/div[1]/div/div[2]/div/div/div/div/div[2]/div/button[1]"}

Traceback (most recent call last):
File "D:\Instagram_Bot\Insta-Bot-master\src\start.py", line 36, in
button_login = webdriver.find_element(By.XPATH, '/html/body/div[2]/div/div/div[3]/div/div/div[1]/div/div[2]/div/div/div/div/div[2]/div/button[1]')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 741, in find_element
return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 347, in execute
self.error_handler.check_response(response)
File "C:\Users\admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[2]/div/div/div[3]/div/div/div[1]/div/div[2]/div/div/div/div/div[2]/div/button[1]"}
(Session info: chrome=119.0.6045.160); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
GetHandleVerifier [0x00007FF7CAD682B2+55298]
(No symbol) [0x00007FF7CACD5E02]
(No symbol) [0x00007FF7CAB905AB]
(No symbol) [0x00007FF7CABD175C]
(No symbol) [0x00007FF7CABD18DC]
(No symbol) [0x00007FF7CAC0CBC7]
(No symbol) [0x00007FF7CABF20EF]
(No symbol) [0x00007FF7CAC0AAA4]
(No symbol) [0x00007FF7CABF1E83]
(No symbol) [0x00007FF7CABC670A]
(No symbol) [0x00007FF7CABC7964]
GetHandleVerifier [0x00007FF7CB0E0AAB+3694587]
GetHandleVerifier [0x00007FF7CB13728E+4048862]
GetHandleVerifier [0x00007FF7CB12F173+4015811]
GetHandleVerifier [0x00007FF7CAE047D6+695590]
(No symbol) [0x00007FF7CACE0CE8]
(No symbol) [0x00007FF7CACDCF34]
(No symbol) [0x00007FF7CACDD062]
(No symbol) [0x00007FF7CACCD3A3]
BaseThreadInitThunk [0x00007FFC12817344+20]
RtlUserThreadStart [0x00007FFC12E026B1+33]

unicode error

error

unicode error

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

image

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser chrome
  • Version latest

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

Add any other context about the problem here.

Unable to locate element.

I tried running it on my system, but I am getting an error.

DevTools listening on ws://127.0.0.1:53906/devtools/browser/f0152ab9-0c43-41ac-bb0c-bb0b9036406d
[6644:12600:0121/125942.184:ERROR:device_event_log_impl.cc(211)] [12:59:42.184] USB: usb_device_handle_win.cc:1020 Failed to 
read descriptor from node connection: A device attached to the system is not functioning. (0x1F)

Traceback (most recent call last):
  File "c:\Users\Asus\Documents\Insta-Bot-master\start.py", line 32, in <module>
    button_login = webdriver.find_element_by_xpath('//html//body//div[1]//section//main//div//article//div//div[1]//div//form//div//div[3]//button//div')
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 
394, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 
976, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 
321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Asus\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//html//body//div[1]//section//main//div//article//div//div[1]//div//form//div//div[3]//button//div"}
  (Session info: chrome=87.0.4280.141)

start py - Insta-Bot-master - Visual Studio Code 1_21_2021 12_59_28 PM

The Chrome browser is launching fine and the credentials get filled in, but it is unable to login.

Login • Instagram - Google Chrome 1_21_2021 12_59_53 PM

noob needs help

hi guys its been very annoying and i need help please
obrázek_2023-08-29_105337377

ModuleNotFoundError: No module named 'pandas'

Login error and dosen't accept cookies

Error:

Warning (from warnings module):
File "C:\Users\strys\OneDrive\Desktop\Insta-Bot-master\start.py", line 22
webdriver = webdriver.Chrome(executable_path=chromedriver_path)
DeprecationWarning: executable_path has been deprecated, please pass in a Service object
Traceback (most recent call last):
File "C:\Users\strys\OneDrive\Desktop\Insta-Bot-master\start.py", line 27, in
username = webdriver.find_element_by_name('username')
AttributeError: 'WebDriver' object has no attribute 'find_element_by_name'

Crush Traceback (most recent call last):

Traceback (most recent call last):
File "D:\Users\Chair\PycharmProjects\InstaBot\venv\lib\site-packages\pandas\core\indexes\base.py", line 3080, in get_loc
return self._engine.get_loc(casted_key)
File "pandas_libs\index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 4554, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 4562, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: '0'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:/Users/Chair/PycharmProjects/InstaBot/venv/InstaBot2.py", line 30, in
prev_user_list = list(prev_user_list['0'])
File "D:\Users\Chair\PycharmProjects\InstaBot\venv\lib\site-packages\pandas\core\frame.py", line 3024, in getitem
indexer = self.columns.get_loc(key)
File "D:\Users\Chair\PycharmProjects\InstaBot\venv\lib\site-packages\pandas\core\indexes\base.py", line 3082, in get_loc
raise KeyError(key) from err
KeyError: '0'

Process finished with exit code 1

solved

When i run:
SyntaxError

(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

Error in fiinding Element

= RESTART: C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\start.py =
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\start.py", line 32, in
button_login = webdriver.find_element_by_xpath('//html//body//div[1]//section//main//div//article//div//div[1]//div//form//div//div[3]//button//div')
File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//html//body//div[1]//section//main//div//article//div//div[1]//div//form//div//div[3]//button//div"}
(Session info: chrome=87.0.4280.88)

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.