Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.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
为什么Selenium获得子元素的速度很慢_Selenium_Selenium Webdriver_Webdriver_Web Crawler_Implicitwait - Fatal编程技术网

为什么Selenium获得子元素的速度很慢

为什么Selenium获得子元素的速度很慢,selenium,selenium-webdriver,webdriver,web-crawler,implicitwait,Selenium,Selenium Webdriver,Webdriver,Web Crawler,Implicitwait,例如,HTML: <input type="hidden" name="ie" value="utf-8"> 当我使用代码时,此元素没有子元素: List<WebElement> childElements = ele.findElements(By.xpath("./*")); List childElements=ele.findElements(By.xpath(“./*”); 程序使用很长的时间(大约30秒)返回结果。结果大小是正确的,即零。 那么我该如

例如,HTML:

<input type="hidden" name="ie" value="utf-8">

当我使用代码时,此元素没有子元素:

List<WebElement> childElements = ele.findElements(By.xpath("./*"));
List childElements=ele.findElements(By.xpath(“./*”);
程序使用很长的时间(大约30秒)返回结果。结果大小是正确的,即零。 那么我该如何解决这个问题呢?谢谢。

根据文档说明,执行时有效的
隐式等待时间会影响该方法。当隐式等待时,
findElements()
方法将在找到的集合中有超过0个项时返回,或者在达到超时时返回空列表

可能您已经在这段代码之前的某个地方设置了,并将其配置为30秒。因此,超时发生在30秒