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

This package is auto-updated.

Last update: 2024-04-17 03:25:50 UTC


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;
}