github-actions[bot] commited on
Commit
63e8a3b
·
1 Parent(s): 751c65c

Update from GitHub Actions

Browse files
Files changed (1) hide show
  1. src/index.ts +3 -3
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() * 2000 + 1000)
229
 
230
  // 随机鼠标移动
231
  await gensparkPage.mouse.move(
@@ -242,7 +242,7 @@ app.get('/genspark', async (c) => {
242
 
243
  // 等待输入框出现
244
  await gensparkPage.waitForSelector(inputSelector, { state: 'visible', timeout: 5000 });
245
-
246
  // 方法2:模拟逐字输入(更像人类)
247
  const testMessage = '模拟真实输入过程';
248
  for (let char of testMessage) {
 
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() * 1500 + 500)
229
 
230
  // 随机鼠标移动
231
  await gensparkPage.mouse.move(
 
242
 
243
  // 等待输入框出现
244
  await gensparkPage.waitForSelector(inputSelector, { state: 'visible', timeout: 5000 });
245
+ gensparkPage.focus(inputSelector);
246
  // 方法2:模拟逐字输入(更像人类)
247
  const testMessage = '模拟真实输入过程';
248
  for (let char of testMessage) {