import time
msg1 = f"Привет, {name}!" #Первая строка сообщения
msg2 = f"Твой номер #{numb}." #Вторая строка
msg_box = driver.find_element_by_xpath("//*[@id='main']/footer/div[1]/div[2]/div/div[2]")
msg_box.click()
for s in (msg1, msg2):
for c in s:
msg_box.send_keys(s)
time.sleep(0.2)
ActionChains(driver).key_down(Keys.SHIFT).key_down(Keys.ENTER).key_up(Keys.SHIFT).key_up(Keys.ENTER).perform()
ActionChains(driver).send_keys(Keys.RETURN).perform()
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
driver.get('https://rublix.best/')
history_xpath = './/div[@class="history-wrapper"]//div'
WebDriverWait(driver=driver, timeout=15).until(
expected_conditions.presence_of_element_located((By.XPATH, history_xpath))
)
for elem in driver.find_elements_by_xpath(history_xpath):
print(elem.get_attribute('textContent'))
1.22
1.52
4.94
4.25
3.26
1.71
12.16
1.56
1.30
1.18
2.58
1.46
1.91
1.17
4.63
5.01
0
1.44
7.05
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_experimental_option(
'prefs',
{
'profile.managed_default_content_settings.javascript': 2,
'profile.managed_default_content_settings.images': 2,
'profile.managed_default_content_settings.mixed_script': 2,
'profile.managed_default_content_settings.media_stream': 2,
'profile.managed_default_content_settings.stylesheets':2
}
)
driver = webdriver.Chrome(options=options)
'//*[@id="courses"]/tbody/tr[12]/td[3]/a'
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
target_name = 'Иванов И.И.'
driver = webdriver.Chrome()
driver.get(
'https://zhenyanovokshanov1.wixsite.com/klinika/bookings-checkout/%D0%BE%D1%84%D1%82%D0%B0%D0%BB%D1%8C%D0%BC%D0%BE%D0%BB%D0%BE%D0%B3/book'
)
driver.switch_to.frame(driver.find_element_by_xpath('.//iframe'))
dropdown_menu = WebDriverWait(driver, 30).until(EC.visibility_of_element_located((
By.XPATH, './/span[@data-hook="dropdown-select-label"]'
)))
dropdown_menu.click()
target_elem = WebDriverWait(driver, 30).until(EC.visibility_of_element_located((
By.XPATH, f'.//li[contains(text(), "{target_name}")]'
)))
target_elem.click()
driver.switch_to.default_content()