kkamara / amazon-scraper

:cityscape: (Live Link) (2022) Navigates to amazon, searches for samsung phones and pulls the title and price data. I highly recommend working with Linux (including virtual machines) or MacOs.
https://github.com/kkamara/amazon-scraper/actions
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Add php artisan make:crawler #1

Closed kkamara closed 2 years ago

kkamara commented 2 years ago

Resolved.

kkamara commented 2 years ago
# updating-command.txt

use Illuminate\Console\Command;
needs
use Illuminate\Console\Command;
use App\Browser;
use Facebook\WebDriver\WebDriverBy;

protected $description = 'Command description';
needs
private Browser $browser;

public function __construct(Browser $browser)
{
    parent::__construct();
    $this->browser = $browser;
}

private function getInput() {
    echo 'say smtn:'.PHP_EOL;
    $words = $this->ask('>>');
    $this->info($words);
}

return 0;
needs

$this->browser->browse(function (\Laravel\Dusk\Browser $browser) {
    $browser->visit('https://www.selenium.dev/');
});
$this->browser->quit();

return 0;
kkamara commented 2 years ago
# updating-command.sh

commandPath="app/Console/Commands"
commandName="CrawlerTest"

file="$commandPath/$commandName.php"

sed -i "s/NewCrawler2022/1/g" $file