Skip to content

Commit 8d60b59

Browse files
committed
fix(scraper): update User-Agent string for Puppeteer and Axios to latest version
1 parent e62e01e commit 8d60b59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/scraper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function fetchWithPuppeteer(url, retries = 3, delay = 5000) {
3838
headless: true
3939
});
4040
const page = await browser.newPage();
41-
await page.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36');
41+
await page.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/120.0.0.0 Safari/537.36');
4242
await page.goto(url, { waitUntil: 'networkidle2', timeout: 60000 }); // Increased to 60 seconds
4343
await page.waitForSelector('#datatable tbody tr', { timeout: 30000 }); // Increased to 30 seconds
4444

@@ -77,7 +77,7 @@ async function fetchWithAxios(url, retries = 3, delay = 5000) {
7777
try {
7878
const response = await axios.get(url, {
7979
headers: {
80-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36',
80+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/120.0.0.0 Safari/537.36',
8181
},
8282
timeout: 30000, // Increased to 30 seconds
8383
});

0 commit comments

Comments
 (0)