Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (120 points)
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
webdriver = webdriver.Chrome("chromedriver.exe")
webdriver.get('https://czateria.interia.pl/emb-chat,room,311,Mężowie i żony')
czateria = webdriver.find_element_by_id('intro-start')
czateria.click()
time.sleep(2)
text = webdriver.find_element_by_id('box-interface-input')
text.send_keys("Fajna strona")
text.send_keys(Keys.ENTER)

C:\Users\perys\PycharmProjects\moje\venv\Scripts\python.exe C:/Users/perys/PycharmProjects/moje/venv/bot.py
Traceback (most recent call last):
  File "C:/Users/perys/PycharmProjects/moje/venv/bot.py", line 6, in <module>
    self.driver.find_element_by_id('manage_description').send_keys("TEST")
NameError: name 'self' is not defined

Process finished with exit code 1

Who will help me fix this error I want the text to appear in the chat, for example: 10 different texts without pressing the run in pycharm

Please log in to answer this question.

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...