【问题标题】:How to structure a python phantomjs project for deployment to heroku如何构建一个python phantomjs项目以部署到heroku
【发布时间】:2014-01-20 03:53:06
【问题描述】:

我正在尝试使用 python/selenium 和 phantomjs 设置一个测试项目。

在 windows 本地我在 virtualenv 中有我项目的 python 部分:

from selenium import webdriver
driver = webdriver.PhantomJS(executable_path="C:\phantomjs.exe")

通过 git 推送到 heroku 应该没问题,可能把第二行改成:

driver = webdriver.PhantomJS()

但是是否可以将 phantomjs 的可执行文件推送到同一个 heroku 应用程序并通过 selenium 访问它。如果有,这是怎么做到的?

【问题讨论】:

    标签: python git selenium heroku phantomjs


    【解决方案1】:

    使用 heroku buildpacks 将二进制文件推送到您的应用程序。

    我也是 Heroku 新手。

    我设法将这个 repo https://github.com/leesei/heroku-casper-node 推送到 heroku(它包含节点、phantomjs、casperjs,您可以向其中添加 python buildpack)并且您可能需要将 phantomjs 添加到环境路径(我看到的 buildpacks 似乎已经这样做了)

    【讨论】:

      猜你喜欢
      • 2016-12-12
      • 2017-01-28
      • 2018-01-23
      • 2018-02-17
      • 2021-09-10
      • 1970-01-01
      • 2016-07-06
      • 2019-07-28
      • 2015-09-29
      相关资源
      最近更新 更多