- import requests
- # URL for the main action
- url = 'https://toolkit.tesco.com/partner/reports/'
- # Define options for each category/subcategory
- Country = ['UK', 'ROI']
- Report_type = ['Sales and stock', 'Range conformance', 'Promotional funding', 'Auto sales out retro deals', 'Fulfilment fee', 'Performance summary', 'Cost price amendments', 'Purchase order amendments']
- Product_subgroup = ['All product subgroups']
- Products = ['All products']
- View = ['TPNB – Total sales', 'TPNB – Sales x store', 'TPNB – Sales x store format', 'TPNB - Sales x DC','Product subgroup - Total sales','Stores - Total sales','Store Format - Total sales']
- Time_period = ['Last full week (Wk 08)']
- # Iterate over combinations of options
- for country in Country:
- for report_type in Report_type:
- for product_subgroup in Product_subgroup:
- for product in Products:
- for view in View:
- for time_period in Time_period:
- # Send request to select options
- options_data = {
- 'Country': country,
- 'Report type': report_type,
- 'Product subgroup': product_subgroup,
- 'Product': product,
- 'View': view,
- 'Time period': time_period
- }
- try:
- response = requests.get(url, params=options_data)
- response.raise_for_status() # Raise exception for 4xx or 5xx errors
- # Process the response as needed
- print(f"Options selected: {options_data}")
- print("Response:", response.text)
- except requests.exceptions.HTTPError as err:
- print(f"An error occurred: {err}")
[text] K
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: