Build a simple web crawler service (server and client) in a programming language of your choice.
The server would receive requests from a client to crawl a URL and should send the response i.e sitemap back to the client.
The Service/Server which is crawler should be limited to one domain
A web server written in Golang which crawls a URL and generate all the links present in each page of the base url.
The only prerequisite is to have go1.19.5
installed in the local system!!
First clone the repository somewhere in your $PATH. A common place would be within your $GOPATH.
Build and copy Web_Crawler
to your $GOPATH/bin:
$ make install
This command will build the Web Crawler binary, named Web_Crawler
. This binary will be created in the root of your project folder.
$ make build
- First Step:
Start a server at the port :8080 by running this command
go run main.go
OR
Web_Crawler
- Second Step:
Paste this url in your browser and fill the form and submit. It will take a while to load and all the links will be generated on the screen
http://localhost:8080/form.html
- First Step:
Build the dockerfile
docker build -t <image-name>
- Second Step:
Run the dockerfile
docker run -d -p 8080:8080 <image name>
- Third Step:
Paste this url in your browser and fill the form and submit. It will take a while to load and all the links will be generated on the screen
http://localhost:8080/form.html
Made using html for a simple and smooth user experience!
Here is the preview of my server :
http://localhost:8080/form.html
(form layout)
Press Ctrl + C
in the terminal to stop the server.