1 year ago

#154715

test-img

Javi Albors

PhantomJS status fails after request to page that loads with JavaScript

I'm trying to get the HTML DOM from the following website: https://www.inputbcn.com/en/tickets#/events

The 'default' DOM of this website its the following:

<!doctype html>
<html lang="">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> 
</head>
<body>
    <div id="xceed-widget"></div>
    
   <script src="https://s3-eu-west-1.amazonaws.com/xceed-widget/2019-version/dist/loader.js" type="text/javascript"></script>
</body>
</html>

As you can see, when the page loads, a JavaScript script is called which will fill the page DOM.

I want to get the full page DOM after the script is executed and I'm using PhantomJS for this purpose. I began with the following code:

var page = require('webpage').create();

page.open("https://www.inputbcn.com/en/tickets#/events", function(status) {
    console.log("Status: " + status);

    if (status === "success") {
        console.log(page.content);
    }
});

But after executing this piece of code, I can see the response status fails.

How can I get the full document of this specific website?

NOTE: this answers did not help my purpose.

html

phantomjs

0 Answers

Your Answer

Accepted video resources