discogs-marketplace-api-nodejs 1.16.6 → 1.16.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -64,13 +64,14 @@ async function scrape({ currencies, genres, formats, formatDescriptions, conditi
|
|
|
64
64
|
].filter(([, p]) => !!p)).toString(),
|
|
65
65
|
].join('?');
|
|
66
66
|
const browserPage = await browserContext.newPage();
|
|
67
|
+
await browserPage.goto('https://www.discogs.com/shop/mywants', { waitUntil: 'commit' });
|
|
67
68
|
await browserPage.setExtraHTTPHeaders({
|
|
68
69
|
'User-Agent': 'Discogs',
|
|
69
70
|
Accept: 'application/json',
|
|
70
71
|
'Accept-Language': 'en-US,en;q=0.9,fr-FR;q=0.8',
|
|
71
72
|
Referer: 'https://www.discogs.com/shop/mywants',
|
|
72
73
|
});
|
|
73
|
-
const response = await browserPage.goto(urlGenerated);
|
|
74
|
+
const response = await browserPage.goto(urlGenerated, { waitUntil: 'domcontentloaded' });
|
|
74
75
|
if (!response?.ok()) {
|
|
75
76
|
const message = response?.headers()['content-type']?.includes('application/json')
|
|
76
77
|
? (await response.json())?.detail
|
|
@@ -33,7 +33,7 @@ async function scrapeWantlist(searchParams, browserContext) {
|
|
|
33
33
|
Referer: url,
|
|
34
34
|
});
|
|
35
35
|
await browserPage.route('**/*', route => (route.request().resourceType() === 'document' ? route.continue() : route.abort()));
|
|
36
|
-
const response = await browserPage.goto(url);
|
|
36
|
+
const response = await browserPage.goto(url, { waitUntil: 'domcontentloaded' });
|
|
37
37
|
const [total, ids] = await Promise.all([
|
|
38
38
|
browserPage.evaluate(() => +(document.querySelector('.pagination_total')?.textContent.split(' of ').pop()?.replace(',', '') ?? '0')),
|
|
39
39
|
browserPage.evaluate(() => {
|