Files
Srilekha 12f0786be9
HIFFI Multi-Platform CI / test (3.11) (push) Failing after 39s
HIFFI Multi-Platform CI / test (3.12) (push) Failing after 39s
feat: complete Day 2 handoff with API service, PM2 process daemons, and test suites
2026-10-30 11:10:54 +05:30

38 lines
1.2 KiB
Python

"""
dump_riaa_rows.py
Dumps the exact cell contents of all rows in table id='search-award-table' for Cam'ron.
"""
import requests
from bs4 import BeautifulSoup
session = requests.Session()
session.headers.update({
"User-Agent": (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/124.0.0.0 Safari/537.36"
),
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
})
print("Fetching RIAA search page for Cam'ron...")
params = {
"tab_active": "default-award",
"se": "Cam'ron"
}
resp = session.get("https://www.riaa.com/gold-platinum/", params=params, timeout=20)
soup = BeautifulSoup(resp.text, "html.parser")
table = soup.find("table", {"id": "search-award-table"})
if not table:
print("Could not find table id='search-award-table'!")
else:
rows = table.find_all("tr")
print(f"Total rows found in search-award-table: {len(rows)}\n")
for i, r in enumerate(rows):
cells = [td.get_text(" ", strip=True) for td in r.find_all(["th", "td"])]
print(f"--- ROW {i} ---")
print(f"Raw Cells List: {cells}")
print(f"Row Full Text : {r.get_text(' | ', strip=True)}\n")