Home > Backend Development > PHP Tutorial > curl的一些小疑点

curl的一些小疑点

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:50:59
Original
953 people have browsed it

curl的一些小问题
请教一下把一个网页的某部分内容抓取出来是怎么实现的...没有思路....
比如说我想抓取mmcfood.1x.net里面的表格...其他的都不要..

------解决方案--------------------

PHP code
$ch = curl_init();curl_setopt($ch, CURLOPT_URL, 'http://mmcfood.1x.net/');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');$htmls = curl_exec($ch);curl_close($ch);preg_match("#
Copy after login
]*)>(.*?)
#is", $htmls, $matches);echo $matches[0];
Related labels:
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
Latest Issues
curl simulated login
From 1970-01-01 08:00:00
0
0
0
Convert cURL command line to PHP cURL code
From 1970-01-01 08:00:00
0
0
0
Convert command line cURL to PHP cURL
From 1970-01-01 08:00:00
0
0
0
How to set boolean value true in php curl
From 1970-01-01 08:00:00
0
0
0
Please tell me, php curl request page shows blank
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template