小编Sta*_*Edd的帖子

selenium.common.exceptions.InvalidCookieDomainException:消息:使用 Selenium 在 Django 中执行测试时无效的 cookie 域

我正在使用 seleniumgrid 为 chrome 和 firefox 设置测试。我正在使用 docker images selenium-hub 和 selenium node-chrome 和 node-firefox,如下所示。

  app:
    build: .
    command: gunicorn --reload --capture-output --log-level debug --access-logfile - -w 3 -b 0.0.0.0 app.wsgi
    restart: always
    volumes_from:
        - initialize
    ports:
      - "8000:8000"
    links:
      - db
      - rabbitmq
      - selenium_hub
    env_file: secrets.env
    volumes:
        - ./app/:/code/

  selenium_hub:
    image: selenium/hub
    ports:
      - 4444:4444
    expose:
      - 4444
    tty: true
    environment:
      - GRID_MAX_SESSION=20
      - GRID_NEW_SESSION_WAIT_TIMEOUT=60000
      - GRID_BROWSER_TIMEOUT=300
      - GRID_TIMEOUT=300
      - TIMEOUT=300
  node_1:
    image: selenium/node-chrome
    depends_on:
      - selenium_hub
    environment: …
Run Code Online (Sandbox Code Playgroud)

django selenium selenium-grid docker docker-compose

8
推荐指数
2
解决办法
2万
查看次数

使用weeasy print和django从html模板编写多页pdf

您好,我正在从包含行数不同的表格的 html 模板生成 PDF,问题是当行数超过一定数量(12)时,其余行加上页脚会进一步推到下方,并且不会出现在生成的 PDF 中pdf.如何使其动态,以便将额外的信息推送到新页面,每个页面至少有一定数量的行,或者如果当前已满,是否有一种方法 weasy print 将数据移动到另一页

到目前为止,我的模板上有分页符,但它已经起作用了。

{% for record in data %}
    <tr>
        <td> {{ record.id}}</td>
        <td> {{ record.date}}</td>
    </tr>
    {% if forloop.counter|divisibleby:12 %}
        <div style="page-break-after: always;"></div>
        div style="page-break-before: always;"></div>
    {% endif %}
{% endfor %}
Run Code Online (Sandbox Code Playgroud)

django weasyprint

3
推荐指数
1
解决办法
8586
查看次数