Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/11.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
如何使用SeleniumPerlAPI获取当前url_Perl_Url_Selenium - Fatal编程技术网

如何使用SeleniumPerlAPI获取当前url

如何使用SeleniumPerlAPI获取当前url,perl,url,selenium,Perl,Url,Selenium,我只是想获取页面的当前绝对url。下面是代码片段 my $url_str = "BEFORE"; $sel->storeLocation("url_str"); $sel->comment(URL is $url); Send command: storeLocation|url_str| Got result : OK Comment : URL is BEFORE 它似乎不起作用。我尝试使用$url\u str、\$url\u str作为storeLocation的

我只是想获取页面的当前绝对url。下面是代码片段

my $url_str = "BEFORE";
$sel->storeLocation("url_str");
$sel->comment(URL is $url);

Send command: storeLocation|url_str|
Got result  : OK
Comment     : URL is BEFORE

它似乎不起作用。我尝试使用$url\u str、\$url\u str作为storeLocation的参数,但没有成功。请帮助我了解我在这里到底遗漏了什么

Perl API使用了更高级的“get_uuu”作为前缀,而不是Selenium标准的“store”。Perl API也使用下划线而不是大小写

# returns the current url
$sel->get_location()
另见:

CPAN上的文档 CPAN上的文档
Perl API使用更为简练的“get_”作为前缀,而不是Selenium标准的“store”。Perl API也使用下划线而不是大小写

# returns the current url
$sel->get_location()
另见:

CPAN上的文档 CPAN上的文档
很抱歉打扰你们$sel->get_location是一个API,可以将其作为答案发布并接受,也可以删除该问题;很抱歉打扰你们$sel->get_location是一个API,可以将其作为答案发布并接受,也可以删除该问题;