github-actions[bot] commited on
Commit
7436105
·
1 Parent(s): c88d203

Update from GitHub Actions

Browse files
Files changed (1) hide show
  1. src/index.ts +4 -4
src/index.ts CHANGED
@@ -208,7 +208,7 @@ app.get('/genspark', async (c) => {
208
  await gensparkContext.clearCookies()
209
  await gensparkContext.addCookies(cookies);
210
  }
211
- //await new Promise(resolve => setTimeout(resolve, 1000));
212
  const gensparkPage = await gensparkContext.newPage()
213
  try {
214
  // 模拟真实用户行为
@@ -225,7 +225,7 @@ app.get('/genspark', async (c) => {
225
  })
226
 
227
  // 等待并模拟人类交互
228
- await gensparkPage.waitForTimeout(Math.random() * 1500 + 500)
229
 
230
  // 随机鼠标移动
231
  await gensparkPage.mouse.move(
@@ -242,9 +242,9 @@ app.get('/genspark', async (c) => {
242
 
243
  // 等待输入框出现
244
  await gensparkPage.waitForSelector(inputSelector, { state: 'visible', timeout: 5000 });
245
- gensparkPage.focus(inputSelector);
246
  // 模拟逐字输入(更像人类)
247
- const testMessage = '模拟输入';
248
  for (let char of testMessage) {
249
  await gensparkPage.type(inputSelector, char, {
250
  delay: Math.random() * 100 + 50 // 随机延迟,模拟打字速度
 
208
  await gensparkContext.clearCookies()
209
  await gensparkContext.addCookies(cookies);
210
  }
211
+ await new Promise(resolve => setTimeout(resolve, 1000));
212
  const gensparkPage = await gensparkContext.newPage()
213
  try {
214
  // 模拟真实用户行为
 
225
  })
226
 
227
  // 等待并模拟人类交互
228
+ await gensparkPage.waitForTimeout(Math.random() * 2000 + 1000)
229
 
230
  // 随机鼠标移动
231
  await gensparkPage.mouse.move(
 
242
 
243
  // 等待输入框出现
244
  await gensparkPage.waitForSelector(inputSelector, { state: 'visible', timeout: 5000 });
245
+
246
  // 模拟逐字输入(更像人类)
247
+ const testMessage = '模拟真实输入过程';
248
  for (let char of testMessage) {
249
  await gensparkPage.type(inputSelector, char, {
250
  delay: Math.random() * 100 + 50 // 随机延迟,模拟打字速度