Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Instagramlogin Error (Selenium)
I tried to make a python program that can (should) login into Instagram. Here's the code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

# Login Data Example001:

#[email protected]
#[email protected]
#[email protected]

class InstagramBot:

    def __init__(self, username, password):
        self.username = username
        self.password = password
        self.driver = webdriver.Firefox()

    def closeBrowser(self):

    def login(self):
        driver = self.driver
        login_button = driver.find_element_by_xpath("//a[@href='/accounts/login/']")
        user_name_elem = driver.find_element_by_xpath("//input[@name='username']")
        password_elem = driver.find_element_by_xpath("//input[@name='password']")

example001 = InstagramBot("[email protected]", "[email protected]")
When i try to run it, it manages to open the front page of Instagram, but it produces the following error:
C:\Users\Julian\PycharmProjects\ib\venv\Scripts\python.exe C:/Users/Julian/PycharmProjects/ib/ Traceback (most recent call last): File "C:/Users/Julian/PycharmProjects/ib/", line 41, in <module> example001.login() File "C:/Users/Julian/PycharmProjects/ib/", line 26, in login driver.get("") File "C:\Users\Julian\PycharmProjects\ib\venv\lib\site-packages\selenium\webdriver\remote\", line 333, in get self.execute(Command.GET, {'url': url}) File "C:\Users\Julian\PycharmProjects\ib\venv\lib\site-packages\selenium\webdriver\remote\", line 321, in execute self.error_handler.check_response(response) File "C:\Users\Julian\PycharmProjects\ib\venv\lib\site-packages\selenium\webdriver\remote\", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Reached error page: about:neterror?e=dnsNotFound&u=https%3A// Process finished with exit code 1
I recently tried to login into Instagram, with an test account using Pycharm and then that Error occured. I tried to fix it, but it still doesn't work like it should. The program is able to open the Instagram front page, but there it stops and that error occours. I followed this youtube Tutorial to make this:

Possibly Related Threads…
Thread Author Replies Views Last Post
  Selenium weird error julio2000 0 1,255 Feb-23-2020, 01:24 PM
Last Post: julio2000
  Selenium webdriver error WiPi 4 9,373 Feb-09-2020, 11:38 AM
Last Post: WiPi
  error when running headless selenium julio2000 2 3,041 Feb-01-2020, 12:41 PM
Last Post: julio2000
  Error clicking button with selenium julio2000 4 4,022 Jan-06-2020, 10:59 AM
Last Post: julio2000
  Selenium error with ebdriver (geckodriver) Martinelli 4 3,491 Sep-24-2019, 01:40 AM
Last Post: Martinelli
  Python Selenium .click() Loads Error - Works Manually.- Events not Triggered NSearch 24 8,095 Aug-14-2019, 02:23 PM
Last Post: NSearch
  Error when trying to use Selenium ejected 1 3,986 Mar-26-2019, 04:53 AM
Last Post: ejected
  selenium error : evilcode1 7 4,015 Nov-12-2018, 01:08 PM
Last Post: snippsat
  Getting error when accessing elements in a modal window of an webpage using selenium sumandas89 3 7,210 Jul-13-2018, 10:44 AM
Last Post: mlieqo
  Python 3/selenium - nontype error water_fox 2 9,210 Jun-28-2018, 08:19 PM
Last Post: Sudhakar

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020