Selenium
- 10 ответов
- 0 вопросов
12
Вклад в тег
import org.openqa.selenium.chrome.ChromeOptions;
WebDriver driver = new ChromeDriver();
ChromeOptions options = new ChromeOptions();
options.addArguments("--remote-allow-origins=*");
WebDriver driver = new ChromeDriver(options);
from selenium import webdriver
from fake_useragent import UserAgent
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
ua = UserAgent()
url = "https://www.nealthy.com/alpha"
options = webdriver.ChromeOptions()
options.add_argument(f'user-agent={ua.chrome}')
web_driver = Service('C:\\webdriver\\chromedriver.exe') #ПУТЬ К ВЕБ ДРАЙВЕРУ
driver = webdriver.Chrome(service=web_driver, options=options)
driver.get(url=url)
# Выше приведен ваш код, изменения начинаются здесь
shadow_host = driver.find_element(By.XPATH, '//form-widget')
shadow_root = shadow_host.shadow_root
shadow_content = shadow_root.find_element(By.CSS_SELECTOR, '#firstname')
shadow_content.send_keys('Mikhail')
//div[contains(@class, "qa-NameField")]//input