I've been working on testing a large sitemap, same as this question here.
The answer worked well up to a point, then started getting status code 429 which is because the web site thinks I'm carrying out a Denial of Service attack.
How do overcome that issue?
cy.request('sitemap.xml')
.then(response => {
return Cypress.$(response.body).find('loc')
.toArray().map(el => el.innerText)
})
.then(urls => {
urls.forEach(url => {
cy.request({url, failOnStatusCode: false})
.then(response => results.push({url, status: response.status}))
})
})
})