社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  docker

Chrome在docker容器中返回状态码400

Tralots • 5 年前 • 1543 次点击  

铬合金参数 ("--headless", "--no-sandbox", "--disable-dev-shm-usage")

directConnection: true,
disableChecks: true

能力:

acceptInsecureCerts: true
acceptSslCerts: true

我还在.env文件中添加了以下内容:

NODE_TLS_REJECT_UNAUTHORIZED=0

{
  method: 'Network.responseReceived',
  params: {
    frameId: '721A00F872D1255AA1DAE58D2DF5D75E',
    loaderId: '70EAE0F82B0AB6BDE6489BC26D77DA34',
    requestId: '117.239',
    response: {
      connectionId: 309,
      connectionReused: true,
      encodedDataLength: 123,
      fromDiskCache: false,
      fromPrefetchCache: false,
      fromServiceWorker: false,
      headers: [Object],
      mimeType: 'application/problem+json',
      protocol: 'h2',
      remoteIPAddress: 'remote ip',
      remotePort: 443,
      securityDetails: [Object],
      securityState: 'insecure',
      status: 400,
      statusText: '',
      timing: [Object],
      url: 'https://api call link'
    },
    timestamp: 15184.562748,
    type: 'XHR'
  }
}
{
  method: 'Network.dataReceived',
  params: {
    dataLength: 185,
    encodedDataLength: 0,
    requestId: '117.239',
    timestamp: 15184.562954
  }
}
{
  method: 'Network.dataReceived',
  params: {
    dataLength: 0,
    encodedDataLength: 203,
    requestId: '117.239',
    timestamp: 15184.563471
  }
}
{
  method: 'Network.loadingFinished',
  params: {
    encodedDataLength: 326,
    requestId: '117.239',
    shouldReportCorbBlocking: false,
    timestamp: 15184.552973
  }
}

需要注意的是,当在docker容器外部本地运行时,此函数按预期工作,并且API调用返回状态代码:200

P、 美国在Zelenium运行的结果和docker本地运行的结果相同。

Failed to load resource: the server responded with a status of 400 ()
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/55121
 
1543 次点击  
文章 [ 1 ]  |  最新文章 5 年前
DebanjanB
Reply   •   1 楼
DebanjanB    5 年前

状态:400

状态:400 暗示 400 Bad Request 超文本传输协议 400 Bad Request 响应状态代码表示服务器无法或将不会处理该请求,原因可能是客户端错误,例如请求语法格式错误、请求消息帧无效或请求路由欺骗。


您的代码测试、相关的HTML和完整的错误堆栈跟踪中的一些信息可以帮助我们更好地分析问题。但是,根据 Failed to load resource: the server responded with a status of 400 () 看来 HTML DOM webpage 包含 AJAX JavaScript

所以当你调用 get() 网络驱动器 可点击的元素

  • 相关的 JavaScript AJAX调用 已完成渲染 DOM Tree
  • 所需的元素是 启用 看得见的 承认 click

您可以在中找到一些相关的讨论:


tl;博士

Failed to load resource: the server responded with a status of 429 (Too Many Requests) and 404 (Not Found) with ChromeDriver Chrome through Selenium