alc/sitemap-crawler

递归爬取sitemap.xml并返回收集到的URL数组

v2.0.0 2021-04-26 16:31 UTC

This package is auto-updated.

Last update: 2024-08-26 23:52:14 UTC


README

递归爬取sitemap.xml并返回收集到的URL数组

安装

composer require alc/sitemap-crawler

使用方法

require __DIR__.'/vendor/autoload.php';

use Alc\SitemapCrawler;

$crawler = new SitemapCrawler();

$data = $crawler->crawl('https://chemel.blog/sitemap.xml');

print_r($data);

在终端中使用

php crawl.php https://chemel.blog/sitemap.xml