-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
28 lines (25 loc) · 1.3 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { ScraperCategories } from "./lib/ScraperCategories.js";
import { ScraperCategory } from "./lib/ScraperCategory.js";
import { ScraperCompany } from "./lib/ScraperCompany.js";
import { getCategories, getCompaniesUrls } from "./utils/request_utils.js";
const main = async () => {
try {
// ******************** Scrape URL and name for each category ******************** //
// Scrape the URL and name of each category from the website. This will give us a list of categories to scrape companies from.
await ScraperCategories();
// ******** Scrape companies URLs for each category ******** //
// For each category, scrape the URLs of all the companies in that category. This will give us a list of company URLs to scrape company details from.
const categories_urls = await getCategories();
await ScraperCategory(categories_urls);
// ********** Scrape all details of each company for each category *********** //
// For each company URL, scrape all the details of the company, such as company name, address, phone number, website, and email address.
const companies_urls = await getCompaniesUrls();
await ScraperCompany(companies_urls);
} catch (err) {
console.log({ "error message": err.message });
}
};
main();
// net start MongoDB
// net STOP MongoDB
// net status MongoDB