mirror of
https://github.com/davidjohnbarton/crawler-google-places.git
synced 2025-12-12 16:38:45 +00:00
Tried to fix bug with missing element
This commit is contained in:
parent
3b1b16cc8c
commit
600d1be1ee
|
|
@ -18,6 +18,9 @@ const enqueueAllUrlsFromPagination = async (page, requestQueue) => {
|
|||
// Need to get results again, pupptr lost context..
|
||||
await page.waitForSelector('.searchbox');
|
||||
await page.waitFor(() => !document.querySelector('#searchbox').classList.contains('loading'));
|
||||
await page.waitFor((resultIndex) => {
|
||||
return document.querySelectorAll('.section-result h3').length >= resultIndex + 1;
|
||||
}, {}, resultIndex);
|
||||
results = await page.$$('.section-result');
|
||||
const link = await results[resultIndex].$('h3');
|
||||
await link.click();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user