cURL crawling page simple web crawler

Simple use of cURL

<?php
    $curl=curl_init("http://www.baidu.com");
 //创建curl资源  
    curl_exec($curl);                                           //传递给浏览器
    curl_close($curl);                                            //关闭curl释放资源
?>

Create a new php file and write it to the file.

Open cmd and enter the web directory.

QQ截图20161105161206.png

Then you can use dir to view the folder contents

QQ截图20161105161312.png

Select the edited php file

QQ截图20161105161602.png

Then export

QQ截图20161105161707.png

In the folder we can see baidu.html

QQ截图20161105161541.png

The page that opens is as follows. This is our simplest crawler.

Continuing Learning
||
<?php $curl=curl_init("http://www.baidu.com"); //创建curl资源 curl_exec($curl); //传递给浏览器 curl_close($curl); //关闭curl释放资源 ?>
submitReset Code