30 lines
1.0 KiB
Python
30 lines
1.0 KiB
Python
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}")
|