

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Main
incomplete
2: Get HTML
incomplete
3: Adding Recursion
incomplete
This lesson's interactive features are locked, please to keep using them
Let's get to work on the actual application! Our program takes as a command line argument the website URL we want to crawl (or at least the page we want to start from)
Remember, you can run the program itself using npm:
npm run start BASE_URL
Where BASE_URL is the root URL of the website we want to crawl. For example: https://learnwebscraping.dev/practice/ecommerce/.
Create a main function and call it.
function main() {
// ?
}
main();
You will need to process command line arguments for this step.
All your main function should do at this point is:
The number of arguments we pass to npm is not equal to the number of arguments to our CLI.
This is a good example of some code that's a bit weird to test with unit tests. Just run the dang thing with too few, just the right amount, and too many arguments to ensure it behaves as expected.
Run and submit the CLI tests from the root of the project.