How to make additional request inside addHandler() function? #1567
-
Hi, how can I make additional request inside my addHandler() function? router.addHandler('LIST', async ({ request, $, log }) => {
...
// How can I make additional request to json endpoint here?
await Dataset.pushData(myobj);
} For context, I need to click a button to see the content, but I'd like to stick with CheerioCrawler for now since everything else works fine. This button click calls json endpoint. I guess I could call the json endpoint directly inside the handler function. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can use the |
Beta Was this translation helpful? Give feedback.
You can use the
sendRequest
contextual helper, it will use got-scraping to run the request and respect all the crawler options like proxy configuration. By default it uses the currently processed request options, but you can override them, e.g. override just the URL (or maybe method and payload too):https://crawlee.dev/docs/guides/got-scraping