diduk001

ermolaev/parser.py

Oct 27th, 2022
726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. from unittest import result
  2. from requests import get
  3. url = 'https://store.tildacdn.com/api/getproductslist/?storepartuid=956794658561&recid=480540430&c=1666868572073&getparts=true&getoptions=true&slice=1&size=36'
  4. results = get(url).json()
  5. products = results['products']
  6. print(f"Всего {results['total']} продуктов")
  7. for idx, product in enumerate(products):
  8.     title = product['title']
  9.     text = product['text'].replace("<br />", '').replace("&nbsp;", ' ')
  10.     print(f"{idx + 1}: {title} - {text}")
  11.  
Advertisement
Add Comment
Please, Sign In to add comment