Ребята, перечитал все доки и все что можно перепробовал. Не жмется кнопка.
Есть сайт по ссылке. Мне надо надо нажать на кнопку-"книжку" так чтобы вылезло меню.
Вот мой код:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
def init_driver():
driver = webdriver.Chrome()
driver.wait = WebDriverWait(driver, 3)
return driver
def city_selection(web_adress):
driver.get(web_adress)
try:
driver.find_element_by_id("id19").click()
except TimeoutException:
print("Box or Button not found")
if __name__ == "__main__":
driver = init_driver()
url = "https://www.torgi.gov.ru/lotSearch1.html;jsessionid=_78AGWSGMkMPvWl9ischcC3w9OdwRFAI1-ZqINqZ8RLYRf1VtMBk!-1927104539!-1149436043?bidKindId=13"
city_selection(url)
пишет:
raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"id","selector":"id19"}
пробовал также
driver.find_element_by_class("ss_sprite ss_book_open").click()
пишет: driver.find_element_by_class("ss_sprite ss_book_open").click() AttributeError: 'WebDriver' object has no attribute 'find_element_by_class'
пробовал Xpath:
driver.find_element_by_xpath("//a[@id='id19']/img[contains(@class, 'ss_sprite ss_book_open')]/@src").click()
пишет:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//a[@id='id19']/img[contains(@class, 'ss_sprite ss_book_open')]/@src"} (Session info: chrome=68.0.3440.84)
Что я делаю не так?