driver = webdriver.Chrome(executable_path="C:\Users\стёпа\Desktop\AutoReg-Google\chromedriver\chromedriver.exe", options=options)
//figure[@data-test-component="UserCell"]//img//parent::*
from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
options = Options()
options.add_argument('start-maximized')
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
driver.get('https://youla.ru/ussuriysk/muzhskaya-odezhda/golovnye-ubory/bieisbolka-64242510e55e932c144e9578')
driver.find_element(By.XPATH, '//figure[@data-test-component="UserCell"]//img//parent::*').click()
sleep(10)
from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
driver.set_window_size(800, 800)
driver.get('https://youla.ru/ussuriysk/muzhskaya-odezhda/golovnye-ubory/bieisbolka-64242510e55e932c144e9578')
driver.find_element(By.XPATH, '//figure[@data-test-component="UserCell"]//img//parent::*').click()
sleep(10)
from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
options = Options()
options.add_argument('start-maximized')
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
driver.get('https://youla.ru/ussuriysk/muzhskaya-odezhda/golovnye-ubory/bieisbolka-64242510e55e932c144e9578')
driver.find_element(By.XPATH, "//figure[@data-test-component='UserCell']//img").click()
sleep(10)
С методом поиска по XPATH ситуация такая - если искать так: '//*[@title="Связь"][1]' (во вкладке elements) то ситуация похоже на первый способ: по первому индексу находится два элемента.
<tbody>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</tbody>
А в консоли через document.querySelector пишет, что невалидный селектор.
const videoElements = document.getElementsByTagName('video');
for (const currentVideoElement of videoElements) {
currentVideoElement.addEventListener('volumechange', () => {
for (const otherVideoElement of videoElements) {
if (otherVideoElement !== currentVideoElement) {
otherVideoElement.muted = true;
}
}
});
}
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-gpu-vsync --disable-frame-rate-limit
start chrome --args --disable-gpu-vsync --disable-frame-rate-limit
Что-то типа такого должно быть