Reducing the amount of List in a WebScraper
0
At the moment, I'm learning and experimenting on the use of web scraping content from different varieties of web pages. But I've come across a common smelly code among several of my applications. I have many repetitive List that has data being append to them. from requests import get import requests import json from time import sleep import pandas as pd url = 'https://shopee.com.my/api/v2/flash_sale/get_items?offset=0&limit=16&filter_soldout=true' list_name = list_price = list_discount = list_stock = response = get(url) json_data = response.json() def getShockingSales(): index = 0 if response.status_code is 200: print('Api Satus: ' + 'OK') else: print('API unable to access') total_flashsale = 15 for i in range(