forked from Dicklesworthstone/agentic_coding_flywheel_setup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresearch_vps_pricing.mjs
More file actions
155 lines (124 loc) · 5.57 KB
/
research_vps_pricing.mjs
File metadata and controls
155 lines (124 loc) · 5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import { chromium } from 'playwright';
import { writeFileSync } from 'fs';
const SCREENSHOT_DIR = './research_screenshots';
async function researchContabo() {
console.log('\n=== CONTABO VPS RESEARCH ===\n');
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
viewport: { width: 1440, height: 900 },
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
});
const page = await context.newPage();
try {
// Visit Contabo VPS page
console.log('Visiting Contabo VPS page...');
await page.goto('https://contabo.com/en/vps/', { waitUntil: 'networkidle', timeout: 60000 });
await page.waitForTimeout(3000);
// Take screenshot of main VPS page
await page.screenshot({ path: `${SCREENSHOT_DIR}/contabo_vps_main.png`, fullPage: false });
console.log('Screenshot saved: contabo_vps_main.png');
// Get pricing information from the page
const vpsPlans = await page.evaluate(() => {
const plans = [];
// Look for pricing cards
const cards = document.querySelectorAll('.product-card, .pricing-card, [class*="vps"], [class*="plan"]');
cards.forEach(card => {
const text = card.innerText;
if (text.includes('€') || text.includes('$') || text.includes('RAM') || text.includes('vCPU')) {
plans.push(text.substring(0, 500));
}
});
return plans;
});
console.log('\nContabo VPS Plans Found:');
vpsPlans.slice(0, 5).forEach((plan, i) => {
console.log(`\n--- Plan ${i + 1} ---`);
console.log(plan);
});
// Scroll down to see more plans
await page.evaluate(() => window.scrollBy(0, 800));
await page.waitForTimeout(1000);
await page.screenshot({ path: `${SCREENSHOT_DIR}/contabo_vps_plans.png`, fullPage: false });
console.log('Screenshot saved: contabo_vps_plans.png');
// Try to find and click on Cloud VPS L or similar high-RAM plan
console.log('\nLooking for Cloud VPS L or 32GB RAM plan...');
// Get all text content to understand the page structure
const pageText = await page.evaluate(() => document.body.innerText);
// Look for pricing patterns
const priceMatches = pageText.match(/(\d+[\.,]\d{2})\s*(€|EUR|\$|USD).*?(per month|\/mo|monthly)/gi);
if (priceMatches) {
console.log('\nPrices found:');
priceMatches.slice(0, 10).forEach(p => console.log(' ' + p));
}
// Look for RAM specs
const ramMatches = pageText.match(/\d+\s*GB\s*(RAM|Memory)/gi);
if (ramMatches) {
console.log('\nRAM options found:');
[...new Set(ramMatches)].forEach(r => console.log(' ' + r));
}
// Try clicking configure on a plan
const configButtons = await page.$$('text=Configure, text=Order, text=Add to cart');
if (configButtons.length > 0) {
console.log(`\nFound ${configButtons.length} configuration buttons`);
}
// Take full page screenshot
await page.screenshot({ path: `${SCREENSHOT_DIR}/contabo_full_page.png`, fullPage: true });
console.log('Screenshot saved: contabo_full_page.png');
} catch (error) {
console.error('Error researching Contabo:', error.message);
await page.screenshot({ path: `${SCREENSHOT_DIR}/contabo_error.png` });
}
await browser.close();
}
async function researchOVH() {
console.log('\n=== OVH VPS RESEARCH ===\n');
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
viewport: { width: 1440, height: 900 },
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
});
const page = await context.newPage();
try {
// Visit OVH VPS page (US site)
console.log('Visiting OVH VPS page...');
await page.goto('https://us.ovhcloud.com/vps/', { waitUntil: 'networkidle', timeout: 60000 });
await page.waitForTimeout(3000);
// Take screenshot
await page.screenshot({ path: `${SCREENSHOT_DIR}/ovh_vps_main.png`, fullPage: false });
console.log('Screenshot saved: ovh_vps_main.png');
// Get page content
const pageText = await page.evaluate(() => document.body.innerText);
// Look for pricing
const priceMatches = pageText.match(/\$[\d,]+\.?\d*\s*(\/mo|per month|monthly)?/gi);
if (priceMatches) {
console.log('\nPrices found:');
[...new Set(priceMatches)].slice(0, 15).forEach(p => console.log(' ' + p));
}
// Look for plan names
const planMatches = pageText.match(/(VPS\s+\w+|Starter|Essential|Comfort|Elite)/gi);
if (planMatches) {
console.log('\nPlan types found:');
[...new Set(planMatches)].forEach(p => console.log(' ' + p));
}
// Scroll to see plans
await page.evaluate(() => window.scrollBy(0, 600));
await page.waitForTimeout(1000);
await page.screenshot({ path: `${SCREENSHOT_DIR}/ovh_vps_plans.png`, fullPage: false });
console.log('Screenshot saved: ovh_vps_plans.png');
// Take full page screenshot
await page.screenshot({ path: `${SCREENSHOT_DIR}/ovh_full_page.png`, fullPage: true });
console.log('Screenshot saved: ovh_full_page.png');
} catch (error) {
console.error('Error researching OVH:', error.message);
await page.screenshot({ path: `${SCREENSHOT_DIR}/ovh_error.png` });
}
await browser.close();
}
async function main() {
console.log('Starting VPS pricing research...\n');
await researchContabo();
await researchOVH();
console.log('\n=== RESEARCH COMPLETE ===');
console.log(`Screenshots saved to ${SCREENSHOT_DIR}/`);
}
main().catch(console.error);