Get meta information, title and all images of any webpage using php

旧街凉风 提交于 2019-12-13 19:23:09

问题


I want to get all the meta information like description, title, keyword etc of any web page using php.

I am using get_meta_tags php function but its displaying warning. I have paste the error below.

Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: No such host is known. in filename......

And how could i get all images on the web page?

Thanks in advance.


回答1:


"getaddrinfo failed" suggests that your webserver's dns client isn't configured properly. Thererfore php cannot resolve "google.com" to an actual ip address.




回答2:


I think you're putting an address as link identifier (http://path/to/your/file.php)? And not a file (file.php)?



来源:https://stackoverflow.com/questions/1838616/get-meta-information-title-and-all-images-of-any-webpage-using-php

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