muriloloffi / buscador-cursos
Projeto que busca os cursos no site da Alura para fins de aprendizado;
v1.1.1
2020-10-16 19:19 UTC
Requires
- guzzlehttp/guzzle: ^7.2
- symfony/css-selector: ^5.1
- symfony/dom-crawler: ^4.4
Requires (Dev)
- phan/phan: ^3.2
- phpunit/phpunit: ^9.4
- squizlabs/php_codesniffer: ^3.5
README
[PHP code practice]
Simple HTTP client that fetches content lists from a specified domain and presents through command line shell.
Downloading package
Inside the project folder you want to add this package, type in the command line:
$ composer require muriloloffi/buscador-cursos
Usage example
Through the command line, navigate to the folder where the package has been added and type the following:
$ vendor\bin\buscar-cursos.php
OR
You can create a php file with the following code:
<?php $client = new Client(['base_uri' => 'https://www.alura.com.br/']); $crawler = new Crawler(); $buscador = new BuscadorDeCursos($client, $crawler); $cursos = $buscador->buscar('/cursos-online-programacao/php'); foreach ($cursos as $curso) { echo $curso . PHP_EOL; }