<p>отправить файл лс , у меня сайт список таблицы запрос сервер разные стороны работает но когда много запросить появиться сбой , как может сделать запрос по очереди через 30 сек либо минут</p><p>async function fetchDataSequentially() {</p><p> const rows = document.querySelectorAll('<a href="http://tr.auto">tr.auto</a>');</p><p> let index = 0;</p><p> async function processRow() {</p><p> if (index < rows.length) {</p><p> const row = rows;</p><p> const urlCell = row.querySelector('.priseSTMJsonUrl');</p><p> const url = urlCell.textContent;</p><p> try {</p><p> const response = await fetch(`/your-server-endpoint?url=${encodeURIComponent(url)}`);</p><p> if (!response.ok) {</p><p> throw new Error(`HTTP error! status: ${response.status} ${response.statusText}`);</p><p> }</p><p> const data = await response.json();</p><p> if (data.error) {</p><p> throw new Error(`Server error: ${data.error}`);</p><p> }</p><p> const priceCell = row.querySelector('td:last-child');</p><p> priceCell.textContent = data.lowest_price;</p><p> index++;</p><p> setTimeout(processRow, 30000);</p><p> } catch (error) {</p><p> console.error('Ошибка при обработке строки:', error);</p><p> const priceCell = row.querySelector('td:last-child');</p><p> priceCell.textContent = "Ошибка запроса";</p><p> index++;</p><p> setTimeout(processRow, 30000);</p><p> }</p><p> }</p><p> }</p><p> processRow();</p><p>}</p><p>fetchDataSequentially();</p>