diaslasd / busca_cursos
Busca cursos da Alura
v1.0.1
2021-05-23 13:26 UTC
Requires
- guzzlehttp/guzzle: ^7.3
- symfony/css-selector: ^5.2
- symfony/dom-crawler: ^5.2.9
Requires (Dev)
- phan/phan: ^4.0
- phpunit/phpunit: ^9
- squizlabs/php_codesniffer: ^3.6
This package is not auto-updated.
Last update: 2024-11-05 05:10:05 UTC
README
PHP Composer: Dependências, Autoload e Publicação
Composer
composer require diaslasd/busca_cursos
Exemplo de uso
require 'vendor/autoload.php'; use Alura\BuscadorDeCursos\Buscador; use GuzzleHttp\Client; use Symfony\Component\DomCrawler\Crawler; $client = new Client(['verify' => false]); $crawler = new Crawler(); $url = 'https://www.alura.com.br/cursos-online-programacao/php'; $filtro = 'span.card-curso__nome'; $buscador = new Buscador($client, $crawler); $cursos = $buscador->buscar($url, $filtro); foreach ($cursos as $curso) { echo $curso->textContent . PHP_EOL; }