-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
36 lines (31 loc) · 988 Bytes
/
cli.py
File metadata and controls
36 lines (31 loc) · 988 Bytes
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
29
30
31
32
33
34
35
36
"""
Method and script to run the complete ETL, through a call or command line
"""
import argparse
import asyncio
from src.etl import etl_contacts
if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog="ScrapContacts",
description="Scrap contacts info from page of a specific category",
)
parser.add_argument(
"search_term", type=str, help="Term used during the search for the links"
)
parser.add_argument(
"-o", "--output", type=str, help="Output CSV file name", default="contacts.csv"
)
parser.add_argument(
"-n", "--number", type=int, help="Number of results expected", default=3
)
parser.add_argument(
"-e",
"--exclude",
metavar="S",
type=str,
nargs="+",
help="List of sites to exclude from search",
default=[],
)
args = parser.parse_args()
asyncio.run(etl_contacts(args.search_term, args.number, args.exclude, args.output))