1 回答
TA贡献1865条经验 获得超7个赞
您循环了该 url,因此它转到了第 1 页。
driver.get('http://atlas.brain-map.org/atlas?atlas=265297126#atlas=265297126&plate=102339919&structure=10155&x=42480&y=16378&zoom=-7&resolution=124.49&z=2')
for i in range(1,106):
try:
paths=WebDriverWait(driver, 30).until(EC.presence_of_all_elements_located((By.TAG_NAME, "path")))
for path in paths:
structure = path.get_attribute('structure_id')
d = path.get_attribute('d')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CLASS_NAME, "simstripImgSel"))).send_keys("F")
time.sleep(0.5)
except Exception as e:
print(e)
进口
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
添加回答
举报