1

I want to get the html of this page for parsing(click the link to understand what content i want to get).

750-bond list

Here's my code to request this page content

    var https = require("https");

    var fs = require("fs");

var options = {
    hostname: "www.prizebond.net",
    port: 443,
    path: "/dlist.php?num=455",
    method: "GET"

};

var response = "";

var req = https.request(options, function (res) {
    res.setEncoding("UTF-8");
    console.log(res.statusCode);
    res.on("data", function (chunk) {
        response += chunk;
    });

    res.on("end", function () {

        fs.writeFile("750-bond.html", response, function (err) {

            if (err) {
                console.log(err.message);
            }
            console.log("File downloaded");

        });
        console.log("end");

    });
});

req.end();

Now the problem is that in my 750-bont.html file, I am getting the weird the result of "Checking your browser before accessing the prizebond.net" not the original content. Here's the screenshot what I got when I open the 750- bond.html file in browser.

750-bond.html

What I am doing wrong? And how can I get the original content of this webpage?

Aamir
  • 101
  • 1
  • 12

1 Answers1

0

You can't, unless you write something more sophisticated, but you probably shouldn't.

The purpose of Cloudflare-protection is to prevent what you are trying to realize unfortunately.

You could look into a possibility to access whatever you want to access by a public API or something that prizebond.net provides for example.

Kaisumaro
  • 31
  • 2