Код: Выделить всё
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
import time
def run():
print('running')
driver = webdriver.Chrome()
driver.set_page_load_timeout(2000)
driver.set_window_size(1024, 600)
driver.maximize_window()
try:
driver.get("https://www.pjdsafetysupplies.com/Admin/Product/List")
selectElement = Select(driver.find_element(By.ID, "SearchCategoryId"))
selectElement.select_by_visible_text('Special Offers')
search = driver.find_element(By.ID, 'search-products')
search.click()
driver.find_element(By.XPATH,".//button[@data-toggle='dropdown']").click()
driver.find_element(By.XPATH,".//button[@name='exportexcel-all']").click()
except Exception as e:
print("Page Load Fail:"+str(e))
finally:
driver.quit()
run()
HTTPConnectionPool(host='localhost', port=54896): время ожидания чтения истекло. (время чтения = 120)
Я пытался установить для параметра load_timeout значение 2000, но в сообщении об ошибке указано, что время ожидания чтения равно 120. Я также пробовал установить Timeouts.implicit_wait и Timeouts.script, но я все равно получаю одно и то же сообщение об ошибке.
Подробнее здесь: https://stackoverflow.com/questions/793 ... -generated