Why is this PHP DOM parse with getAttribute not working?

元气小坏坏 提交于 2019-12-13 05:32:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!