command
module
Version:
v0.0.0-...-45c7c1d
Opens a new window with list of versions in this module.
Published: Apr 15, 2024
License: MIT
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
🕷 makescraper

Create your very own web scraper and crawler using Go and Colly!
📚 Table of Contents
- Project Structure
- Getting Started
- Deliverables
- Resources
Project Structure
📂 makescraper
├── README.md
└── scrape.go
Getting Started
-
Visit github.com/new and create a new repository named makescraper.
-
Run each command line-by-line in your terminal to set up the project:
$ git clone git@github.com:Make-School-Labs/makescraper.git
$ cd makescraper
$ git remote rm origin
$ git remote add origin git@github.com:YOUR_GITHUB_USERNAME/makescraper.git
$ go mod download
-
Open README.md in your editor and replace all instances of YOUR_GITHUB_USERNAME with your GitHub username to enable the Go Report Card badge.
Deliverables
Complete each task in the order they appear. Use GitHub Task List syntax to update the task list.
Requirements
Scraping
- IMPORTANT: Complete the Web Scraper Workflow worksheet distributed in class.
- Create a
struct to store your data.
- Refactor the
c.OnHTML callback on line 16 to use the selector(s) you tested while completing the worksheet.
- Print the data you scraped to
stdout.
Stretch Challenges
- Add more fields to your
struct. Extract multiple data points from the website. Print them to stdout in a readable format.
Serializing & Saving
- Serialize the
struct you created to JSON. Print the JSON to stdout to validate it.
- Write scraped data to a file named
output.json.
- Add, commit, and push to GitHub.
Resources
Lesson Plans
Example Code
Scraping
Serializing & Saving
- JSON to Struct: Paste any JSON data and convert it into a Go structure that will support storing that data.
- GoByExample - JSON: Covers Go's built-in support for JSON encoding and decoding to and from built-in and custom data types (structs).
- GoByExample - Writing Files: Covers creating new files and writing to them.
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.