book-details.ts
API. This API take a param bookFullUrl
and then navigates to this url, scrapes the needed data (name, upc, numberOfReviews) from that page and returns it.
`book-details.ts` code
books-all.ts
API. This API scrapes the name and url for all the books on https://books.toscrape.com/. For each url, it calls the extendPayload
function. This function extends the payload of job run and add a new payload item to it. This new payload item will run as part of the same job run.`books-all.ts` code
books-all
). When this API run, it will extend the job run payload and include 1 payload item (api: book-details
) for each book on the main page.
Creating jobs can be done via UI or API. For this example, we will use the UI. Checkout Jobs API overview for more info.
https://webhook.site/
to get a temp url. In a real scenario, you will use your own webhook url and persist the data to store.
<YOUR_WEBHOOK_URL>
with your webhook url.
books-all
API.
Webhook payload