Knowledge Base
main
main
  • Hello , There !!!
  • Blogs , Thoughts , Etc
    • Blogs
      • What happens when you type a URL into your browser?
      • HTTP Keep Alive Vs TCP keep Alive
      • How Browsers Work ?
      • Change Data Capture @ MySQL
    • Batch Vs Stream Processing
    • Book Summaries
      • 12 Rules for Life
    • Random Thoughts
      • Being On The Right Side Of The “Zero”
      • I ̶F̶̶a̶̶i̶̶l̶̶e̶̶d̶ Learnt Something New.
  • NODE JS
    • Parsing HTML DOM
    • Make HTTP Request
    • Read SQLite File
    • Remove Directory Recursively
  • JavaScript
    • Event Loop In JavaScript
  • Numbers
    • Untitled
  • Random
    • Google File System
    • Concurrency vs Parallelism
    • Spark
    • Apache Kafka[WIP]
  • Python
    • Python Memory Model
    • Multithreading With LightWeight Threads
    • Logger
  • JAVA
    • Java Memory Model
  • SQL
    • Untitled
    • Page 1
  • Machine Learning
    • Page 2
  • Productivity
    • Git
    • ssh
  • Hacks
    • Good Youtube Channels
Powered by GitBook
On this page
  • Import Libraries
  • Make Request

Was this helpful?

  1. NODE JS

Make HTTP Request

Import Libraries

const https = require('https');

Make Request

var data = "";

var req = https.get('https://www.imdb.com/chart/top/', function (res) {

    res.setEncoding('utf8');
    res.on('data', function (chunk) {
        data += chunk;
    });

    res.on('end', () => {
        console.log('end the connections');
        parse_html(data);
    });
});


req.on('error' , (err)=>{
    console.log(err.message);
});
PreviousParsing HTML DOMNextRead SQLite File

Last updated 3 years ago

Was this helpful?