Skip to content

Commit c739785

Browse files
committed
update vestiairecollective product scraper test
1 parent f6f4ad8 commit c739785

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

vestiairecollective-scraper/test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
pp = pprint.PrettyPrinter(indent=4)
77

88
# enable scrapfly cache
9-
vestiairecollective.BASE_CONFIG["cache"] = True
9+
vestiairecollective.BASE_CONFIG["cache"] = False
1010

1111

1212
def validate_or_fail(item, validator):
@@ -96,12 +96,12 @@ def validate_or_fail(item, validator):
9696
@pytest.mark.asyncio
9797
@pytest.mark.flaky(reruns=3, reruns_delay=30)
9898
async def test_product_scraping():
99+
search_data = await vestiairecollective.scrape_search(
100+
url="https://www.vestiairecollective.com/search/?q=louis+vuitton", max_pages=1
101+
)
102+
product_urls = ["https://vestiairecollective.com/" + item["link"] for item in search_data][:3]
99103
products_data = await vestiairecollective.scrape_products(
100-
urls=[
101-
"https://us.vestiairecollective.com/men-accessories/watches/patek-philippe/multicolour-pink-gold-patek-philippe-watch-52859536.shtml",
102-
"https://us.vestiairecollective.com/men-accessories/watches/patek-philippe/gold-gold-perpetual-calendar-patek-philippe-watch-55732655.shtml",
103-
"https://us.vestiairecollective.com/men-accessories/watches/patek-philippe/gold-yellow-gold-patek-philippe-watch-51820408.shtml",
104-
]
104+
urls=product_urls
105105
)
106106
validator = Validator(product_schema, allow_unknown=True)
107107
for item in products_data:

0 commit comments

Comments
 (0)