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;








1















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());
);









share|improve this question


























  • 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












  • Thanks, explaned in my response

    – Gilles Quenot
    Mar 27 at 16:34

















1















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());
);









share|improve this question


























  • 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












  • Thanks, explaned in my response

    – Gilles Quenot
    Mar 27 at 16:34













1












1








1








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());
);









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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

















  • 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












  • 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












1 Answer
1






active

oldest

votes


















1













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();

)();





share|improve this answer


























    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
    );



    );













    draft saved

    draft discarded


















    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









    1













    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();

    )();





    share|improve this answer































      1













      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();

      )();





      share|improve this answer





























        1












        1








        1







        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();

        )();





        share|improve this answer















        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();

        )();






        share|improve this answer














        share|improve this answer



        share|improve this answer








        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



















            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.



















            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현