#!/usr/bin/env python3
import requests
import re
import json

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
}

url = 'https://www.ebay.com/deals/electronics'
resp = requests.get(url, headers=headers, timeout=15)
print('Status:', resp.status_code)
print('Length:', len(resp.text))

# Look for JSON-LD
json_matches = re.findall(r'<script[^>]*type="application/ld\+json"[^>]*>([^<]+)</script>', resp.text)
print('JSON-LD blocks:', len(json_matches))

# Try to find any item listings
items = re.findall(r'"name":"([^"]+)"', resp.text)
print('Quoted names:', len(items))
for i in items[:5]:
    if len(i) > 20:
        print(' -', i[:60])

# Check content sample
print('\nContent sample:')
print(resp.text[5000:6000])
