【问题标题】:Why Discord site isn't loaded with Puppeteer Node.js为什么 Discord 网站没有加载 Puppeteer Node.js
【发布时间】:2022-01-29 05:26:22
【问题描述】:
await page.goto('https://discord.com/channels/850682587273625661/919026857926590535', { waitUntil: 'networkidle0', timeout: 0 });
await page.screenshot({ path: 'discor.png' })

这里的主要想法是,如果我加载了 puppeteer.launch() 站点而我使用 puppeteer.connect() 看起来好像 Discord 阻止了我的脚本。有什么办法可以绕过这个 Discord 的限制吗?

【问题讨论】:

    标签: node.js puppeteer


    【解决方案1】:

    此 url 将您重定向到登录页面,然后您必须像手动一样实际登录:

    await page.goto('https://discord.com/channels/850682587273625661/919026857926590535');
    
    // enter email
    const emailtarget = await page.waitForSelector("input[name=email]", {visible: true});
    await emailtarget.type("my@email.com");
    
    // enter password
    const passtarget = await page.waitForSelector("input[name=password]", {visible: true});
    await passtarget.type("mySecretPass");
    
    // submit
    const submitBtn = await page.waitForSelector("button[type=submit]", {visible: true});
    await submitBtn.click();
    
    // wait for redirection
    await page.waitForNavigation();
    
    // should be logged in, take screenshot
    await page.screenshot({ path: 'discor.png' });
    

    【讨论】:

      猜你喜欢
      • 2019-06-11
      • 1970-01-01
      • 2019-07-26
      • 2013-06-19
      • 2021-06-10
      • 1970-01-01
      • 1970-01-01
      • 2021-06-08
      • 2021-09-13
      相关资源
      最近更新 更多