From this page,我想获取value
标签的input
,名称为form_key
。但是我收到以下错误:
Fatal error: Uncaught Error: Call to undefined method simple_html_dom::getAttribute() in test.php:9 Stack trace: #0 {main} thrown in test.php on line 9
请注意,我正在使用PHP Simple DOM解析器。
PHP:
include('simple_html_dom.php');
$html = file_get_html('https://b2b.chiemsee.com/customer/account/login/');
if($html->getAttribute('name') =='form_key'){
echo $html->nodeValue;
}