问题
From this page, I want to get the value
of the input
tag with the name form_key
. But I get the following error:
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
Please note that I am using PHP Simple DOM parser.
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;
}
来源:https://stackoverflow.com/questions/56559115/why-is-this-php-dom-parse-with-getattribute-not-working