Can we fetch HTTP return code of previous call?How does Chrome find the function call stack, can I call it directly in puppeteer?How can I call a function of an element returned as an ElementHandle?Puppeteer when error go to previous function or callPuppeteer authentication does not work in headless mode but yes in non headless modepuppeteer header and footertemplate doesnt workContent from puppeteer script not being fetched in ubunutuUsing Puppeteer, how can I open a page, get the data, then go back to the previous page to get the next page on the list?Log `console` calls made in client-side code from the Puppeteer Node.js processHow can I fetch an url using session data from puppeteer page?For async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves puppeteer and mocha
Why would the US President need briefings on UFOs?
Do ability scores have any effect on casting Wish spell
Was this pillow joke on Friends intentional or a mistake?
Can I switch to third-person while not in 'town' in Destiny 2?
Is it safe to remove the bottom chords of a series of garage roof trusses?
Justifying the use of directed energy weapons
Why were movies shot on film shot at 24 frames per second?
Why does my house heat up, even when it's cool outside?
How to refer to a regex group in awk regex?
Can a character spend multiple hit dice at level 1?
System to validate run time complexity requirements
What is the hex versus octal timeline?
Create Tmux pane with sudo from sudoed pane?
Were there 486SX revisions without an FPU on the die?
How to write triplets in 4/4 time without using a 3 on top of the notes all the time
Does an object count as "being moved" when placed in a Bag of Holding before its wielder moves, and then after moving they take the object out again?
Are there nouns that change meaning based on gender?
map 5 unequal ranges to id
If all stars rotate, why was there a theory developed, that requires non-rotating stars?
Why aren't RCS openings an issue for spacecraft heat shields?
Why is Boris Johnson visiting only Paris & Berlin if every member of the EU needs to agree on a withdrawal deal?
Three Singles in Three Clubs
Why don't we use Cavea-B
Why did this happen to Thanos's ships at the end of "Avengers: Endgame"?
Can we fetch HTTP return code of previous call?
How does Chrome find the function call stack, can I call it directly in puppeteer?How can I call a function of an element returned as an ElementHandle?Puppeteer when error go to previous function or callPuppeteer authentication does not work in headless mode but yes in non headless modepuppeteer header and footertemplate doesnt workContent from puppeteer script not being fetched in ubunutuUsing Puppeteer, how can I open a page, get the data, then go back to the previous page to get the next page on the list?Log `console` calls made in client-side code from the Puppeteer Node.js processHow can I fetch an url using session data from puppeteer page?For async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves puppeteer and mocha
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I search doc and the web, but can't find how to get the HTTP code of a query.
Anyone knows ?
Example :
const puppeteer = require('puppeteer');
const fs = require('fs');
const debug = true;
var base_url = 'https://stackoverflow.com/';
(async () =>
const browser = await puppeteer.launch(
headless: true,
);
const page = await browser.newPage();
await page.goto('https://stackoverflow.com');
// how to get HTTP code of last call ?
await browser.close();
)();
There's response.status() but don't know how to just fetch last query and not all with
page.on('response', response =>
console.log("response code: ", response.status());
);
puppeteer
add a comment |
I search doc and the web, but can't find how to get the HTTP code of a query.
Anyone knows ?
Example :
const puppeteer = require('puppeteer');
const fs = require('fs');
const debug = true;
var base_url = 'https://stackoverflow.com/';
(async () =>
const browser = await puppeteer.launch(
headless: true,
);
const page = await browser.newPage();
await page.goto('https://stackoverflow.com');
// how to get HTTP code of last call ?
await browser.close();
)();
There's response.status() but don't know how to just fetch last query and not all with
page.on('response', response =>
console.log("response code: ", response.status());
);
puppeteer
Can you share some piece of code?
– hardkoded
Mar 27 at 15:47
As I see in docspage.goto('https://stackoverflow.com')
returnsPromise<Response>
so just pass to the promisethen
method the callback function which will revice Response. But using await beforepage.goto
should resolve the returned object directly toResponse
object.
– Take_Care_
Mar 27 at 16:30
Thanks, explaned in my response
– Gilles Quenot
Mar 27 at 16:34
add a comment |
I search doc and the web, but can't find how to get the HTTP code of a query.
Anyone knows ?
Example :
const puppeteer = require('puppeteer');
const fs = require('fs');
const debug = true;
var base_url = 'https://stackoverflow.com/';
(async () =>
const browser = await puppeteer.launch(
headless: true,
);
const page = await browser.newPage();
await page.goto('https://stackoverflow.com');
// how to get HTTP code of last call ?
await browser.close();
)();
There's response.status() but don't know how to just fetch last query and not all with
page.on('response', response =>
console.log("response code: ", response.status());
);
puppeteer
I search doc and the web, but can't find how to get the HTTP code of a query.
Anyone knows ?
Example :
const puppeteer = require('puppeteer');
const fs = require('fs');
const debug = true;
var base_url = 'https://stackoverflow.com/';
(async () =>
const browser = await puppeteer.launch(
headless: true,
);
const page = await browser.newPage();
await page.goto('https://stackoverflow.com');
// how to get HTTP code of last call ?
await browser.close();
)();
There's response.status() but don't know how to just fetch last query and not all with
page.on('response', response =>
console.log("response code: ", response.status());
);
puppeteer
puppeteer
edited Mar 27 at 16:22
Gilles Quenot
asked Mar 27 at 15:44
Gilles QuenotGilles Quenot
114k23 gold badges171 silver badges174 bronze badges
114k23 gold badges171 silver badges174 bronze badges
Can you share some piece of code?
– hardkoded
Mar 27 at 15:47
As I see in docspage.goto('https://stackoverflow.com')
returnsPromise<Response>
so just pass to the promisethen
method the callback function which will revice Response. But using await beforepage.goto
should resolve the returned object directly toResponse
object.
– Take_Care_
Mar 27 at 16:30
Thanks, explaned in my response
– Gilles Quenot
Mar 27 at 16:34
add a comment |
Can you share some piece of code?
– hardkoded
Mar 27 at 15:47
As I see in docspage.goto('https://stackoverflow.com')
returnsPromise<Response>
so just pass to the promisethen
method the callback function which will revice Response. But using await beforepage.goto
should resolve the returned object directly toResponse
object.
– Take_Care_
Mar 27 at 16:30
Thanks, explaned in my response
– Gilles Quenot
Mar 27 at 16:34
Can you share some piece of code?
– hardkoded
Mar 27 at 15:47
Can you share some piece of code?
– hardkoded
Mar 27 at 15:47
As I see in docs
page.goto('https://stackoverflow.com')
returns Promise<Response>
so just pass to the promise then
method the callback function which will revice Response. But using await before page.goto
should resolve the returned object directly to Response
object.– Take_Care_
Mar 27 at 16:30
As I see in docs
page.goto('https://stackoverflow.com')
returns Promise<Response>
so just pass to the promise then
method the callback function which will revice Response. But using await before page.goto
should resolve the returned object directly to Response
object.– Take_Care_
Mar 27 at 16:30
Thanks, explaned in my response
– Gilles Quenot
Mar 27 at 16:34
Thanks, explaned in my response
– Gilles Quenot
Mar 27 at 16:34
add a comment |
1 Answer
1
active
oldest
votes
OK, get it, thanks @Take_Care:
response.status()
const puppeteer = require('puppeteer');
const fs = require('fs');
const debug = true;
var base_url = 'https://stackoverflow.com/';
(async () =>
const browser = await puppeteer.launch(
headless: true,
);
const page = await browser.newPage();
cons ret = await page.goto('https://stackoverflow.com');
console.log(ret.status());
await browser.close();
)();
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55381264%2fcan-we-fetch-http-return-code-of-previous-call%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
OK, get it, thanks @Take_Care:
response.status()
const puppeteer = require('puppeteer');
const fs = require('fs');
const debug = true;
var base_url = 'https://stackoverflow.com/';
(async () =>
const browser = await puppeteer.launch(
headless: true,
);
const page = await browser.newPage();
cons ret = await page.goto('https://stackoverflow.com');
console.log(ret.status());
await browser.close();
)();
add a comment |
OK, get it, thanks @Take_Care:
response.status()
const puppeteer = require('puppeteer');
const fs = require('fs');
const debug = true;
var base_url = 'https://stackoverflow.com/';
(async () =>
const browser = await puppeteer.launch(
headless: true,
);
const page = await browser.newPage();
cons ret = await page.goto('https://stackoverflow.com');
console.log(ret.status());
await browser.close();
)();
add a comment |
OK, get it, thanks @Take_Care:
response.status()
const puppeteer = require('puppeteer');
const fs = require('fs');
const debug = true;
var base_url = 'https://stackoverflow.com/';
(async () =>
const browser = await puppeteer.launch(
headless: true,
);
const page = await browser.newPage();
cons ret = await page.goto('https://stackoverflow.com');
console.log(ret.status());
await browser.close();
)();
OK, get it, thanks @Take_Care:
response.status()
const puppeteer = require('puppeteer');
const fs = require('fs');
const debug = true;
var base_url = 'https://stackoverflow.com/';
(async () =>
const browser = await puppeteer.launch(
headless: true,
);
const page = await browser.newPage();
cons ret = await page.goto('https://stackoverflow.com');
console.log(ret.status());
await browser.close();
)();
edited Mar 27 at 16:34
answered Mar 27 at 16:14
Gilles QuenotGilles Quenot
114k23 gold badges171 silver badges174 bronze badges
114k23 gold badges171 silver badges174 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55381264%2fcan-we-fetch-http-return-code-of-previous-call%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you share some piece of code?
– hardkoded
Mar 27 at 15:47
As I see in docs
page.goto('https://stackoverflow.com')
returnsPromise<Response>
so just pass to the promisethen
method the callback function which will revice Response. But using await beforepage.goto
should resolve the returned object directly toResponse
object.– Take_Care_
Mar 27 at 16:30
Thanks, explaned in my response
– Gilles Quenot
Mar 27 at 16:34