gpt4 book ai didi

selenium - 很抱歉,在使用 Selenium 的自动化测试环境中加载 Google API 时,您的计算机或网络可能会发送自动查询错误

转载 作者:行者123 更新时间:2023-12-03 22:30:06 25 4
gpt4 key购买 nike

我有一个使用 Google API JS 客户端的单页应用程序。

这个应用程序还有一个自动化的功能测试套件,用 Java 和 Selenium 编写,每次构建应用程序时都会在测试环境中运行。测试套件产生多个浏览器,它们或多或少地同时单击应用程序的多个流。

这通常会导致 Google 为以下文件返回 HTTP 403:

<script src="https://apis.google.com/js/api.js"></script>

附加信息:

We're sorry, but your computer or network may be sending automated queries. To protect our users we can't process your request right now.



我尝试查看 Google API 配额,但它们似乎只影响实际的 API 调用,而不影响客户端库本身。

有没有人遇到过类似的问题?我们可以检测到这种情况并重试失败的测试,但这会导致对 apis.google.com 的更多调用并使测试非常缓慢。也更难确定测试时间是否因应用程序更改或 GAPI 客户端库加载失败而增加。

最佳答案

这个错误信息...

We're sorry, but your computer or network may be sending automated queries. To protect our users we can't process your request right now.
...暗示 Google Chrome 浏览器能够检测到您网络上似乎正在向 Google 发送自动流量的设备。
来自支持文章 "Unusual traffic from your computer network" :

"Unusual traffic from your computer network"

If devices on your network seem to be sending automated traffic to Google, you might see the error ..."Our systems have detected unusual traffic from your computer network"...

What Google considers automated traffic

Google considers the following situations as automated traffic:

  • Sending searches from a WebDriver driven browser, robot, computer program, automated service, or search scraper
  • Using software that sends searches to Google to see how a website or webpage ranks on Google

What to do when you see this message

The error page most likely shows a reCAPTCHA. To continue using Google, solve the reCAPTCHA. That is how Google will know you are a human and not a robot. Once you solve the reCAPTCHA, the message will go away and you can use Google again.


引用
您可以在以下位置找到一些相关讨论:
  • How does recaptcha 3 know I'm using selenium/chromedriver?
  • Selenium and non-headless browser keeps asking for Captcha
  • Access Denied page with headless Chrome on Linux while headed Chrome works on windows using Selenium through Python

  • TL; 博士
    "Unusual traffic" blocks searching or requires reCAPTCHA

    关于selenium - 很抱歉,在使用 Selenium 的自动化测试环境中加载 Google API 时,您的计算机或网络可能会发送自动查询错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59823253/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com