Menu Close
    Hire us Request quote Reading list Switch to dark mode

    How to get the HTTP status using CasperJS

    You can get the HTTP status easily using CasperJS. To get HTTP status see the below script. For getting the HTTP status, firstly we will open the site for which we want to get the HTTP status and after that we will use the utils.dump() function.
    The utils module provides simple helper functions, some of them being very specific to CasperJS though. You can check the function references for utils module from CasperJS documentation link- The utils module
    dump() method is used to dumps a JSON representation of passed argument to the standard output.

    Now you have to run the command and you will get your result-
    casperjs file_name.js

    After executing the script, you can get the HTTP status. Refer to below screenshot for the same-

    In case of 404 HTTP status, it will show like this-



    . . .


    Add Your Comment

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just received your message and our expert will get back to you shortly.
    Send Again