Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 单击“搜索”按钮后没有任何进展_Python_Python 3.x_Selenium_Web Scraping - Fatal编程技术网

Python 单击“搜索”按钮后没有任何进展

Python 单击“搜索”按钮后没有任何进展,python,python-3.x,selenium,web-scraping,Python,Python 3.x,Selenium,Web Scraping,我正在使用selenium处理web抓取任务,并一直停留在单击功能上 网站中的步骤: 1.开放网站 2.在搜索文本框中输入键值 3.单击搜索开始搜索过程 在第3步之后,应该加载进度条并开始搜索结果。 然而,在点击搜索后,进度条会出现一秒钟并消失 我的代码: browser = webdriver.Chrome(executable_path='C:/Chrome/chromedriver.exe') browser.set_page_load_timeout(30000) browser.get

我正在使用selenium处理web抓取任务,并一直停留在单击功能上

网站中的步骤: 1.开放网站 2.在搜索文本框中输入键值 3.单击搜索开始搜索过程

在第3步之后,应该加载进度条并开始搜索结果。 然而,在点击搜索后,进度条会出现一秒钟并消失

我的代码:

browser = webdriver.Chrome(executable_path='C:/Chrome/chromedriver.exe')
browser.set_page_load_timeout(30000)
browser.get("labs.nccgroup.trust/typofinder/")
browser.find_element_by_id('host').send_keys("example.com")
elem=browser.find_element_by_xpath("//*[@id='typogulator']/input[2]")
elem.click()
在搜索字段中插入值后尝试使用WebDriverWait

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By

browser = webdriver.Chrome()
browser.get('https://labs.nccgroup.trust/typofinder')
browser.find_element_by_id('host').send_keys("example.com")
ele=WebDriverWait(browser,20).until(EC.element_to_be_clickable((By.XPATH,"//input[@type='submit'][@value='Search']")))
ele.click()

您的脚本是否可能在单击按钮后关闭?可能一些测试侦听器关闭了浏览器。