-
Notifications
You must be signed in to change notification settings - Fork 0
/
ATTARII.py
24 lines (17 loc) · 880 Bytes
/
ATTARII.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from config import parse_args
from dataextractiontools import amazon_tabular_info_scraper, amazon_textual_info_scraper
def main():
"""
Main function for scraping textual and tabular information from an Amazon product page.
This function parses command-line arguments, determines the type of information to extract (tabular or textual),
and initiates the appropriate scraping process based on the provided URL and arguments.
"""
args = parse_args()
if args.info_type == "tabular":
tabular_info_extraction = amazon_tabular_info_scraper.AmazonTabularInfoExtraction(args)
tabular_info_extraction.extract(args.URL)
if args.info_type == "textual":
textual_info_extraction = amazon_textual_info_scraper.AmazonTextualInfoExtraction(args)
textual_info_extraction.extract(args.URL)
if __name__ == "__main__":
main()