from pinscrape import Pinterest
import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()

keyword = "messi"
proxies = {}


def test_v2():
    p = Pinterest(proxies=proxies, sleep_time=1)
    results = p.search(keyword, page_size=3)
    assert len(results) == 3, p.errors
    assert all("title" in r and "image_url" in r for r in results)
    print(f"Found {len(results)} images")
    for r in results:
        print(f"  {r['title'][:50]}")
