예제 #1
0
def main():
    args = parser.parse_args()
    conn = establish_connection(args.database)

    s = Scraper(conn)

    if args.basic:
        if args.year:
            s.scrape_basic(range(args.year, args.year + 1))
        else:
            s.scrape_basic()
    elif args.detailed:
        if args.stdin:
            refs = [x.strip() for x in sys.stdin.readlines()]
            s.scrape_detailed(refs)
        else:
            s.scrape_detailed()
    else:
        s.scrape_all()