You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner. It is now read-only.
The scrape will produce a `\Softonic\LaravelIntelligentScraper\Scraper\Events\Scraped` event if all worked as expected.
167
+
So attach a listener to that event to receive the data.
168
+
169
+
```php
170
+
$event->scrapeRequest->url // Url scraped
171
+
$event->scrapeRequest->type // Request type
172
+
$event->data // Contains all the data in a [ 'fieldName' => 'value' ] format.
180
173
```
181
174
182
175
All the output fields are arrays that can contain one or more results.
183
176
177
+
If the scrape fails a `\Softonic\LaravelIntelligentScraper\Scraper\Events\ScrapeFailed` event is fired with the
178
+
scrape request information.
179
+
```php
180
+
$event->scrapeRequest->url // Url scraped
181
+
$event->scrapeRequest->type // Request type
182
+
```
183
+
184
+
### Queue workers
185
+
186
+
You need to workers, one for the default queue and another for the `configure` queue. The `configure` worker
187
+
should be a single worker to avoid parallel configurations.
188
+
189
+
```bash
190
+
php artisan queue:work # As many as you want
191
+
php artisan queue:work --queue=configure # Just one
192
+
```
193
+
184
194
## Testing
185
195
186
196
`softonic/laravel-intelligent-scraper` has a [PHPUnit](https://phpunit.de) test suite and a coding style compliance test suite using [PHP CS Fixer](http://cs.sensiolabs.org/).
@@ -201,50 +211,87 @@ $ docker-compose run psysh
201
211
The scraper is auto configurable, but needs an initial dataset or add a configuration.
202
212
The dataset tells the configurator which data do you want and how to label it.
0 commit comments