跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] Playwright 不能登录支付宝页面,很诡异,求思路

发表于

Mac 下使用 Playwright 启动的浏览器(chromium, firefox)都不能登录支付宝

  • 无论是脚本输入还是手动输入都失败
  • 如果指定 executablePath ,指向本地 Chrome ,脚本&手动也登录失败
  • 手动启动本地 Chrome ,是可以手动登录的

都提示:登录失败,你可以尝试使用扫码登录或稍后重试。

async function main() {
    const browser = await chromium.launch({
        headless: false, // 可以看到浏览器操作
        executablePath: '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
    })

    const page = await browser.newPage()
    
    // 访问支付宝登录页面
    await page.goto('https://auth.alipay.com/login/index.htm');

    // 等待页面完全加载
    await page.waitForLoadState('networkidle');

    // 慢慢输入用户名
    await page.type('#J-input-user', '<YOUR_USERNAME>', { delay: 100 }); // 每个字符之间延迟 100 毫秒

    // 等待一段时间再输入密码
    await page.waitForTimeout(1000);

    // 慢慢输入密码
    await page.type('#password_rsainput', '<YOUR_PASSWORD>', { delay: 100 }); // 每个字符之间延迟 100 毫秒

    // 点击登录按钮
    await page.click('#J-login-btn');

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.