M
M
Maxim2019-01-04 10:28:25
Python
Maxim, 2019-01-04 10:28:25

'str' type object is not called, what's the problem?

There is this code:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

class instagramBot:
  def __init__(self, login, password):
    self.login = login
    self.password = password
    self.driver = webdriver.Firefox()

  def closeBrowser(self):
    self.driver.close()

  def login(self):
    driver = self.driver
    driver.get("https://www.instagram.com/")
    time.sleep(2)

IB = instagramBot("","")
IB.login()

Execution produces such an error, I can not understand what is wrong.
Traceback (most recent call last):
  File "C:\Users\Max\Desktop\GetFollowersBot\getFollowers.py", line 20, in <module>
    IB.login()
TypeError: 'str' object is not callable

Process finished with exit code 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2019-01-04
@chernyshovmaksim56

Need to rename variable or method "login"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question