File size: 820 Bytes
5221213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# run_scraper.py
import sys
import logging
from app.scraper import FAQUpdater

def main():
    """Run the FAQ scraping process"""
    
    # Setup logging
    logging.basicConfig(
        level=logging.INFO,
        format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
    )
    
    # Check if force update is requested
    force_update = '--force' in sys.argv
    
    # Run updater
    updater = FAQUpdater()
    df = updater.check_and_update(force_update=force_update)
    
    # Display stats
    stats = updater.get_scraping_stats(df)
    print(f"\nScraping Statistics:")
    print(f"Total FAQs: {stats['total_faqs']}")
    print(f"Categories: {stats['categories']}")
    print(f"Category Distribution: {stats['category_distribution']}")

if __name__ == "__main__":
    main()