A kod taki:
Kod: Zaznacz cały
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
webdriver = webdriver.Chrome("chromedriver.exe")
webdriver.get('https:')
obcy = webdriver.find_element_by_id('intro-start')
obcy.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>
obcy = webdriver.find_element_by_id('intro-start')
File "C:\Users\perys\PycharmProjects\moje\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 360, in find_element_by_id
return self.find_element(by=By.ID, value=id_)
File "C:\Users\perys\PycharmProjects\moje\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "C:\Users\perys\PycharmProjects\moje\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\perys\PycharmProjects\moje\venv\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":"css selector","selector":"[id="intro-start"]"}
(Session info: chrome=84.0.4147.89)