使用curl和get_meta_tags()获取元标记信息 [英] getting meta tags info using curl and get_meta_tags()

查看:194
本文介绍了使用curl和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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆