!关于采集页面内容的有关问题

WBOY
Release: 2016-06-13 11:21:00
Original
851 people have browsed it

求救!关于采集页面内容的问题
我想采集http://www.meishichina.com/Topic/CaiXi/XiangCai/这个页面的链接及图片,我要怎么写正则才可以获取菜名、链接及图片地址?我现在为了这个问题尝试了很久都不对,哪位大哥可以帮帮小弟啊,小弟在此跪谢了啊!


------解决方案--------------------
你下载成功了吗?

下载文件,最简单的用file_get_contents,但是,网络不好,这个函数就不好使;否则用curl;

取内容最后的办法是用strpos找特殊汉字,缩小范围之后再用正则。

对于长篇幅的内容,特别是带html的,用正则不好使的
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!