Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/39.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
Node.js 从selenium元素获取字符串_Node.js_Selenium - Fatal编程技术网

Node.js 从selenium元素获取字符串

Node.js 从selenium元素获取字符串,node.js,selenium,Node.js,Selenium,我在用这个: 异步函数afterwait(){ var y=String(wait driver.findElement(By.xpath(“/*[contains(@id,'executable_path')])))).getText()) 控制台日志(y) } 下面是我试图进入这个变量的内容(只有C:\Program Files…): C:\ProgramFiles(x86)\Google\Chrome\Application\Chrome.exe 它等了一会儿,什么也没给我。 如果没有a

我在用这个: 异步函数afterwait(){ var y=String(wait driver.findElement(By.xpath(“/*[contains(@id,'executable_path')])))).getText()) 控制台日志(y) } 下面是我试图进入这个变量的内容(只有
C:\Program Files…
):

C:\ProgramFiles(x86)\Google\Chrome\Application\Chrome.exe
它等了一会儿,什么也没给我。 如果没有async&await,它将返回我“[对象承诺]” 你知道怎么了吗试试这个:

driver.findElement(By.id("executable_path")).getText()