[text] b

Viewer

  1. Options selected: {'Country': 'UK', 'Report type': 'Sales and stock', 'Product subgroup': 'All product subgroups', 'Product': 'All products', 'View': 'TPNB – Total sales', 'Time period': 'Last full week (Wk 08)'}
  2. ValueError: No tables found
  3. File <command-2177609803612567>, line 48
  4.      46 soup = BeautifulSoup(response.text, 'html.parser')
  5.      47 table = soup.find('table')
  6. ---> 48 df = pd.read_html(str(table))[0]
  7.      49 # Construct file name based on selected options
  8.      50 file_name = f"{country}_{report_type}_{product}_{view}_{time_period}.xlsx"
  9. File /databricks/python/lib/python3.11/site-packages/pandas/io/html.py:613, in _BeautifulSoupHtml5LibFrameParser._parse_tables(self, doc, match, attrs)
  10.     610 tables = doc.find_all(element_name, attrs=attrs)
  11.     612 if not tables:
  12. --> 613     raise ValueError("No tables found")
  13.     615 result = []
  14.     616 unique_tables = set()

Editor

You can edit this paste and save as new:


File Description
  • b
  • Paste Code
  • 26 Apr-2024
  • 900 Bytes
You can Share it: