我需要运行这个循环,直到网页上出现“.loadMore”css 选择器:
while ec.presence_of_element_located('.loadMore'):
element_number = 25 * i
wait = WebDriverWait(driver, time1);
sub_button = (by, hook + str(element_number))
wait.until(ec.presence_of_element_located(sub_button))
driver.find_element_by_css_selector(button).click()
time.sleep(5) # Makes the page wait for the element to change
i += 1