puppeteer : wait for ajax call after navigation [duplicate]
This question already has an answer here:
how to handle elements that load after ajax request in puppeteer
1 answer
so in my code i submit a form , wait for navigation and submit a second form ... here is the tricky part ... before the second from submit some data will be loaded in the from with ajax
i want to wait for those ajax call the be done and then submit the second form
here is a simplified version of my code
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation(),
])
if (!await page.$("#form2_element"))
throw new Error(' ELEMENT MISSING 2 ');
await page.$eval('#form2_element', (el, data) => el.value = data.value , data);
await Promise.all([
page.click('#form2_submit'),
page.waitForNavigation(),
])
after this
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation(),
])
how can i say wait for ajax calls ? i tried this
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation({ waitUntil: "networkidle0" }),
])
but it didnt work and for submited before ajax call is done
javascript node.js puppeteer
marked as duplicate by Louis
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 22 '18 at 23:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
how to handle elements that load after ajax request in puppeteer
1 answer
so in my code i submit a form , wait for navigation and submit a second form ... here is the tricky part ... before the second from submit some data will be loaded in the from with ajax
i want to wait for those ajax call the be done and then submit the second form
here is a simplified version of my code
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation(),
])
if (!await page.$("#form2_element"))
throw new Error(' ELEMENT MISSING 2 ');
await page.$eval('#form2_element', (el, data) => el.value = data.value , data);
await Promise.all([
page.click('#form2_submit'),
page.waitForNavigation(),
])
after this
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation(),
])
how can i say wait for ajax calls ? i tried this
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation({ waitUntil: "networkidle0" }),
])
but it didnt work and for submited before ajax call is done
javascript node.js puppeteer
marked as duplicate by Louis
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 22 '18 at 23:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
how to handle elements that load after ajax request in puppeteer
1 answer
so in my code i submit a form , wait for navigation and submit a second form ... here is the tricky part ... before the second from submit some data will be loaded in the from with ajax
i want to wait for those ajax call the be done and then submit the second form
here is a simplified version of my code
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation(),
])
if (!await page.$("#form2_element"))
throw new Error(' ELEMENT MISSING 2 ');
await page.$eval('#form2_element', (el, data) => el.value = data.value , data);
await Promise.all([
page.click('#form2_submit'),
page.waitForNavigation(),
])
after this
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation(),
])
how can i say wait for ajax calls ? i tried this
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation({ waitUntil: "networkidle0" }),
])
but it didnt work and for submited before ajax call is done
javascript node.js puppeteer
This question already has an answer here:
how to handle elements that load after ajax request in puppeteer
1 answer
so in my code i submit a form , wait for navigation and submit a second form ... here is the tricky part ... before the second from submit some data will be loaded in the from with ajax
i want to wait for those ajax call the be done and then submit the second form
here is a simplified version of my code
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation(),
])
if (!await page.$("#form2_element"))
throw new Error(' ELEMENT MISSING 2 ');
await page.$eval('#form2_element', (el, data) => el.value = data.value , data);
await Promise.all([
page.click('#form2_submit'),
page.waitForNavigation(),
])
after this
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation(),
])
how can i say wait for ajax calls ? i tried this
await Promise.all([
page.click('#form1_submit'),
page.waitForNavigation({ waitUntil: "networkidle0" }),
])
but it didnt work and for submited before ajax call is done
This question already has an answer here:
how to handle elements that load after ajax request in puppeteer
1 answer
javascript node.js puppeteer
javascript node.js puppeteer
asked Nov 13 '18 at 15:00
hretichretic
338623
338623
marked as duplicate by Louis
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 22 '18 at 23:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Louis
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 22 '18 at 23:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
If you want to wait for data to be displayed after an AJAX call is made, I'll point you towards my answer on this very topic from another thread:
how to handle elements that load after ajax request in puppeteer
Hopefully this helps!
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you want to wait for data to be displayed after an AJAX call is made, I'll point you towards my answer on this very topic from another thread:
how to handle elements that load after ajax request in puppeteer
Hopefully this helps!
add a comment |
If you want to wait for data to be displayed after an AJAX call is made, I'll point you towards my answer on this very topic from another thread:
how to handle elements that load after ajax request in puppeteer
Hopefully this helps!
add a comment |
If you want to wait for data to be displayed after an AJAX call is made, I'll point you towards my answer on this very topic from another thread:
how to handle elements that load after ajax request in puppeteer
Hopefully this helps!
If you want to wait for data to be displayed after an AJAX call is made, I'll point you towards my answer on this very topic from another thread:
how to handle elements that load after ajax request in puppeteer
Hopefully this helps!
answered Nov 13 '18 at 17:09
AJC24AJC24
1,1932716
1,1932716
add a comment |
add a comment |