使用curl和get_meta_tags()获取元标记信息 [英] getting meta tags info using curl and get_meta_tags()
问题描述
有没有办法使用curl,你可以做一些等同于php中的get_meta_tags()函数?具体来说,使用curl在php中获取外部网站的元标记,尽可能少的开销。
is there a way to use curl such that you can do something that is equivalent to the get_meta_tags() function in php? specifically to get the meta tags of an external site using curl in php with the least amount of overhead possible
推荐答案
有一种使用curl的方法,你可以做一些等同于php中的get_meta_tags()函数的函数
is there a way to use curl such that you can do something that is equivalent to the get_meta_tags() function in php
不,我不这么认为。
最好的方法是获取数据,并使用 HTML解析器。或者,手册中用户提供的说明中有几种基于正则表达式的方法。
The best way would be to fetch the data, and parse it using a HTML parser. Alternatively, there are several regex based approaches in the user contributed notes in the manual.
这篇关于使用curl和get_meta_tags()获取元标记信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!