33 lines
841 B
Python
33 lines
841 B
Python
#!/usr/bin/env python3
|
|
"""Test the updated scraper with GraphQL integration"""
|
|
import asyncio
|
|
import sys
|
|
sys.path.insert(0, 'src')
|
|
|
|
from graphql_client import fetch_lot_bidding_data, format_bid_data
|
|
|
|
async def main():
|
|
# Test with known lot ID
|
|
lot_id = "A1-28505-5"
|
|
|
|
print(f"Testing GraphQL API with lot: {lot_id}\n")
|
|
|
|
bidding_data = await fetch_lot_bidding_data(lot_id)
|
|
|
|
if bidding_data:
|
|
print("Raw GraphQL Response:")
|
|
print("="*60)
|
|
import json
|
|
print(json.dumps(bidding_data, indent=2))
|
|
|
|
print("\n\nFormatted Data:")
|
|
print("="*60)
|
|
formatted = format_bid_data(bidding_data)
|
|
for key, value in formatted.items():
|
|
print(f" {key}: {value}")
|
|
else:
|
|
print("Failed to fetch bidding data")
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|