Rename to hkt.sh

This commit is contained in:
mango
2026-03-21 01:10:53 +08:00
parent 76a263d0f9
commit 8f1171fe99
6676 changed files with 1724268 additions and 0 deletions

31
extract-playwright.js Normal file
View File

@@ -0,0 +1,31 @@
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({ headless: false });
const context = await browser.newContext();
const page = await context.newPage();
console.log('访问页面...');
await page.goto('https://my.rfchost.com/index.php?rp=/store/jp2-tier-1-international-optimization-network');
console.log('等待15秒...');
await page.waitForTimeout(15000);
const title = await page.title();
console.log('标题:', title);
const products = await page.evaluate(() => {
const results = [];
document.querySelectorAll('a[href*="pid="]').forEach(a => {
const url = new URL(a.href);
const pid = url.searchParams.get('pid');
const card = a.closest('.product, .card, div');
const name = card?.querySelector('h3, h4')?.textContent.trim();
if (pid) results.push({ name: name || 'Unknown', pid });
});
return results;
});
console.log(JSON.stringify(products, null, 2));
await browser.close();
})();