Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.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
Google chrome 提取XPath并在google chrome中运行_Google Chrome_Xpath_Console_Syntax Error - Fatal编程技术网

Google chrome 提取XPath并在google chrome中运行

Google chrome 提取XPath并在google chrome中运行,google-chrome,xpath,console,syntax-error,Google Chrome,Xpath,Console,Syntax Error,当我尝试使用以下代码从google chrome控制台测试xpath时,网页中有一个下拉列表: $x("//*[@id="searchResultsList"]/li[2]/div/div/div/pagination-component/div[1]/div[4]/span[2]/select/option[4]") 我看到以下错误 Uncaught SyntaxError: missing ) after argument list 但是我认为我的语法是正确的试试这个,你的字符串格式不正

当我尝试使用以下代码从google chrome控制台测试xpath时,网页中有一个下拉列表:

$x("//*[@id="searchResultsList"]/li[2]/div/div/div/pagination-component/div[1]/div[4]/span[2]/select/option[4]")
我看到以下错误

Uncaught SyntaxError: missing ) after argument list

但是我认为我的语法是正确的

试试这个,你的字符串格式不正确

$x("//*[@id='searchResultsList']/li[2]/div/div/div/pagination-component/div[1]/div[4]/span[2]/select/option[4]")