Giter VIP home page Giter VIP logo

web-parser's Introduction

Web Page Fetcher in Go

This is a simple command-line program implemented in Go that fetches web pages and saves them to disk for later retrieval and browsing.

Getting Started

Prerequisites

Make sure you have docker installed on your machine.

Cloning the Repository

Clone the repository:

git clone https://github.com/karthick2696/web-parser.git

Changing Directory (cd) to the Repository:

cd web-parser

Building the Program

Build the program

docker build -t web-parser .

Running the Program

To fetch a web page, run the following command

Run program without metadata

docker run web-parser https://www.google.com https://autify.com

Run program with metadata:

docker run web-parser --metadata https://www.google.com https://autify.com

Output :

image

To View HTML file

We are running program using docker so html file of website will be stored in docker volumes. Due to that we need to move html files from docker to local

Step 1:

Get docker container id of web-parser using below commend

docker ps -a

Output :

Copy container id

image

Step 2:

  • Copy html files from docker container based on container-id using below commend
  • Replace container-id by value we copied at first step
docker cp container-id:/app/. ./output

Step 3:

  • Files will be moved to output folder of your local code repo
  • nevigate to output folder to view html files using below commends
cd output
ls

Output :

Attached image reference for all three steps

image

Important Condition :-

When ever we run program using docker new container-id will be generated each time. Due to that we need take latest container id to copy files from docker to local machine. otherwise it will copy old files only from old container

web-parser's People

Contributors

karthick2696 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.