Tell the in-app VPS Operator agent what to do — it installs & runs everything on the VPS for you.
8.148.195.137 · Region: China (Guangzhou). Being inside China means it opens Taobao directly — no VPN needed. The agent (poller) on the VPS must already be online before you start.On the VPS, open PowerShell and run:
pm2 statusYou should see a row named poller with status online. If it says stopped/errored or there is no row, the agent can't receive your commands — set up the poller first (Node.js installed, poller.js running under pm2 with the same VPS_AGENT_SECRET as in Base44 Secrets).
In this website, open /admin/vps-agent (admin menu → VPS Agent). You'll chat with the agent. Every prompt in the steps below is meant to be pasted into that chat — the agent writes and runs the PowerShell on the VPS for you, then reports the result.
1a. Ask the agent to create the folder:
Create the folder C:\\scraper if it does not exist.1b. Paste the two scraper files manually (like you did for poller.js):
On the VPS via RDP, open PowerShell and run notepad C:\\scraper\\server.js. When Notepad asks to create the file, click Yes, then paste this code and save (Ctrl+S):
const express = require('express');
const cors = require('cors');
const { chromium } = require('playwright');
const API_KEY = process.env.SCRAPER_API_KEY || 'CHANGE_ME';
const PROFILE_DIR = 'C:\\scraper\\taobao-profile';
const PORT = process.env.PORT || 3000;
const HEADLESS = (process.env.HEADLESS || 'false') === 'true';
const app = express();
app.use(cors());
app.use(express.json({ limit: '10mb' }));
const auth = (req, res, next) => {
if (req.headers['x-api-key'] !== API_KEY) return res.status(401).json({ error: 'unauthorized' });
next();
};
app.get('/health', auth, (req, res) => res.json({ ok: true, time: Date.now() }));
app.post('/search', auth, async (req, res) => {
const { keyword, limit = 10 } = req.body || {};
if (!keyword) return res.status(400).json({ error: 'keyword required' });
let context;
try {
context = await chromium.launchPersistentContext(PROFILE_DIR, {
channel: 'msedge',
headless: HEADLESS,
viewport: { width: 1366, height: 800 },
locale: 'zh-CN',
args: ['--disable-blink-features=AutomationControlled'],
});
const page = await context.newPage();
const url = 'https://s.taobao.com/search?q=' + encodeURIComponent(keyword);
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 45000 });
await page.waitForTimeout(5000);
const items = await page.evaluate((max) => {
const cards = Array.from(document.querySelectorAll('div[class*="Card"], div[class*="card"]'));
const seen = new Set();
const out = [];
for (const c of cards) {
const titleEl = c.querySelector('a, [class*="title"], [class*="Title"]');
const imgEl = c.querySelector('img');
const priceEl = c.querySelector('[class*="price"], [class*="Price"]');
const linkEl = c.querySelector('a[href*="item.taobao"], a[href*="detail.tmall"]') || c.querySelector('a');
const title = (titleEl && titleEl.innerText) ? titleEl.innerText.trim() : '';
const img = imgEl ? (imgEl.src || imgEl.getAttribute('data-src') || '') : '';
const price = (priceEl && priceEl.innerText) ? priceEl.innerText.replace(/[^\d.]/g, '') : '';
const link = linkEl ? linkEl.href : '';
if (!title || !link || seen.has(title + link)) continue;
seen.add(title + link);
out.push({ title, price_cny: price, images: img ? [img] : [], source_url: link });
if (out.length >= max) break;
}
return out;
}, limit);
res.json({ ok: true, keyword, count: items.length, items });
} catch (e) {
res.status(500).json({ ok: false, error: e.message });
} finally {
if (context) { try { await context.close(); } catch {} }
}
});
app.get('/fetch-image', auth, async (req, res) => {
const url = req.query.url;
if (!url) return res.status(400).end();
try {
const r = await fetch(url, { headers: { Referer: 'https://www.taobao.com/' } });
const buf = Buffer.from(await r.arrayBuffer());
res.set('Content-Type', r.headers.get('content-type') || 'image/jpeg');
res.send(buf);
} catch {
res.status(502).end();
}
});
app.listen(PORT, '0.0.0.0', () => console.log('scraper on ' + PORT));Then notepad C:\\scraper\\login.js, click Yes, paste this and save:
const { chromium } = require('playwright');
(async () => {
const ctx = await chromium.launchPersistentContext('C:\\scraper\\taobao-profile', {
channel: 'msedge', headless: false, viewport: { width: 1366, height: 800 }, locale: 'zh-CN',
});
const p = await ctx.newPage();
await p.goto('https://login.taobao.com/');
console.log('Log in with QR or password, then come back here and press Enter to save the profile...');
process.stdin.resume();
process.stdin.once('data', async () => { await ctx.close(); process.exit(0); });
})();Paste this into the agent chat:
In C:\\scraper, run: npm install express cors playwright. Then run: npx playwright install msedge. Report whether each command succeeded.This installs the web server, the browser automation library, and the Edge browser driver Playwright uses. It can take a few minutes — the agent will tell you when it's done.
This step the agent cannot do — it needs your phone. On the VPS via RDP, open PowerShell and run:
$env:SCRAPER_API_KEY="same-value-as-Base44-secret"
node C:\scraper\login.jsA browser opens to Taobao login. Scan the QR code with the Taobao app on your phone (or enter username + password + SMS). After you're logged in, come back to PowerShell and press Enter. The login is saved forever in C:\scraper\taobao-profile.
4a. Agent opens the Windows firewall:
Open Windows firewall inbound port 3000 for TCP. Create the rule named 'Scraper API' if it does not exist.4b. YOU open the Aliyun security group (the VPS can't do this):
3000/3000 · Authorization: 0.0.0.0/0Paste this into the agent chat (use the same API key you set on the VPS):
Start C:\\scraper\\server.js with pm2 as name 'scraper', set env SCRAPER_API_KEY to the value already in the environment, then run pm2 save. Finally run pm2 status and report it.pm2 keeps the scraper alive across crashes and reboots. The agent will paste the pm2 status table back — scraper should show online.
Ask the agent to confirm the scraper answers:
Run this on the VPS and show the full response: curl http://localhost:3000/health -H 'x-api-key: <YOUR_SCRAPER_API_KEY>'Expect {"ok":true,...}. Then test from your PC too:
curl http://8.148.195.137:3000/health -H "x-api-key: YOUR_SCRAPER_API_KEY"Open the Base44 Secrets dashboard and make sure these three values are set and match the VPS:
# These secrets must match between the VPS and Base44:
# SCRAPER_VPS_IP = 8.148.195.137
# SCRAPER_VPS_PORT = 3000
# SCRAPER_API_KEY = (any secret you choose — set the SAME value on the VPS and in Base44 Secrets)The SCRAPER_API_KEY here must equal the one you used in Step 3 and Step 5.
When the health check returns {"ok":true} from your PC, come back and tell me. I'll update the scrapeProducts backend function to call this VPS — it will translate the Chinese title to Bangla, convert CNY → BDT with your margin, and create ShopProduct listings — and I'll add a search box on the Home page so a shopper's search auto-creates buyable listings.
node C:\scraper\login.js on the VPS, solve the captcha, retry./fetch-image?url=... and re-upload (I handle this in the wiring step).{ ok: true } from your PC, tell me — I'll wire the 888-7express search flow next.