feat: complete Day 2 handoff with API service, PM2 process daemons, and test suites
This commit is contained in:
1 parent
564262340a
commit
12f0786be9
27 files changed
+3234
-1013
No files matched your search
@@ -0,0 +1,38 @@
|
||||
"""
|
||||
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")
|
||||
Reference in new issue
Block a user