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,30 @@
|
||||
import re
|
||||
from bs4 import BeautifulSoup
|
||||
import requests
|
||||
|
||||
session = requests.Session()
|
||||
session.headers.update({
|
||||
"User-Agent": (
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
|
||||
"AppleWebKit/537.36 (KHTML, like Gecko) "
|
||||
"Chrome/120.0.0.0 Safari/537.36"
|
||||
),
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||
})
|
||||
|
||||
print("Fetching RIAA main search page...")
|
||||
resp = session.get("https://www.riaa.com/gold-platinum/", timeout=15)
|
||||
print(f"Status Code: {resp.status_code}")
|
||||
|
||||
soup = BeautifulSoup(resp.text, "html.parser")
|
||||
|
||||
scripts = "\n".join([tag.get_text() for tag in soup.find_all("script") if tag.get_text()])
|
||||
|
||||
nonces = re.findall(r'["\']?nonce["\']?\s*[:=]\s*["\']([a-zA-Z0-9]+)["\']', scripts, re.I)
|
||||
print(f"Discovered Nonces: {set(nonces)}")
|
||||
|
||||
forms = soup.find_all("form")
|
||||
print(f"Total Forms Found: {len(forms)}")
|
||||
for idx, f in enumerate(forms):
|
||||
inputs = {inp.get("name"): inp.get("value") for inp in f.find_all("input") if inp.get("name")}
|
||||
print(f"Form {idx} (action='{f.get('action')}'): inputs={inputs}")
|
||||
Reference in new issue
Block a user