File size: 740 Bytes
25ae7fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import asyncio
import sys
import os

# Add the current directory to path
sys.path.append(os.getcwd())

from scraper.engine import LaroozaScraper

# Set encoding to utf-8 for windows console
if sys.platform == "win32":
    import codecs
    sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())

async def test():
    scraper = LaroozaScraper()
    print("DEBUG: Fetching latest movies...")
    items = await scraper.fetch_home(page=1)
    print(f"DEBUG: Found {len(items)} items.")
    if items:
        for i, item in enumerate(items[:3]):
            print(f"  {i+1}. {item['title']} - ID: {item['id'][:20]}...")
    else:
        print("DEBUG: ❌ fetch_home returned 0 items.")

if __name__ == "__main__":
    asyncio.run(test())