我試過xpath,name,id但不知道爲什麼它不起作用。每次我嘗試,它只是說它無法找到元素。硒不能找到元素? (自動化的網絡應用程序)
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def page_is_loaded(driver):
return driver.find_element_by_tag_name("body") != None
driver = webdriver.Chrome('/Users/mattcasey/Desktop/SPLASHFORCE/chromedriver')
driver.get("https://www.adidas.co.uk/on/demandware.store/Sites-adidas-GB-Site/en_GB/MyAccount-Register")
wait = WebDriverWait(driver, 10)
wait.until(page_is_loaded)
first_name_field = driver.find_element_by_name("profile_customer_firstname")
first_name_field.send_keys("Test")
好,複製並粘貼您的網址返回'URL不found'網站,所以請檢查是否有正確的地址。 –
它的這種網站格式化的空間,「https://www.adidas.co.uk/on/demandware.store/Sites-adidas-GB-Site/en_GB/MyAccount-Register」是網站和硒加載現場罰款。 –