Closed soroka41 closed 3 years ago
replacement postData: {} on body: {} --- good works
let data = { body: payload, headers: { "Content-Type": "application/json", 'accept-language': 'en-US,en;q=0.9' } } const response = await cloudflareScraper.post(url, data)
const browser = await puppeteer.launch(LAUNCH_PUPPETEER_OPTS_ALL) const pageSearch = await browser.newPage() await pageSearch.setRequestInterception(true) await pageSearch.on('request', interceptedRequest => { let data = { 'method': 'POST', 'postData': payload, 'headers': { ...interceptedRequest.headers(), "Content-Type": "application/json" } }; interceptedRequest.continue(data); }) await pageSearch.goto(url) const resultsCars = await pageSearch.content() await browser.close() ................................................... How to implement this with await cloudflareScraper.post (url, data)