Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 设置py2app以运行selenium_Python_Selenium_Packages_Py2app - Fatal编程技术网

Python 设置py2app以运行selenium

Python 设置py2app以运行selenium,python,selenium,packages,py2app,Python,Selenium,Packages,Py2app,我在让py2app与使用Selenium的python webscraper程序一起工作时遇到问题 我知道我必须在我的软件包中加入硒元素,但没有任何效果。我看不到错误消息,因为.app无法打开 在我的python fie中的导入如下所示 #! python3 import urllib from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.sup

我在让py2app与使用Selenium的python webscraper程序一起工作时遇到问题

我知道我必须在我的软件包中加入硒元素,但没有任何效果。我看不到错误消息,因为.app无法打开

在我的python fie中的导入如下所示

#! python3
import urllib
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
import pdb
我的setup.py文件如下所示

    """
This is a setup.py script generated by py2applet

Usage:
    python setup.py py2app
"""

from setuptools import setup

APP = ['highlights.py']
DATA_FILES = ['doi_list.txt']
OPTIONS = {'argv_emulation': True
           'packages': ['urllib', 'pdb', 'selenium'] 
}

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)
我跟着玛丽娜·梅莱的,但她只是随便翻看了一下包括包裹在内的东西,我不知道该怎么做。我是编程新手


你知道我做错了什么吗

尝试使用“包含”而不是“包”。(py2app v0.13中的工程)


PS:确保在列表条目之间添加逗号

也许您可以尝试以下方法:

driver_path = 'xxxx/chromedriver'  # path of your chromedriver
DATA_FILES = ['doi_list.txt', driver_path]
它对我有用

并确保
app/Contents/Resources/chromedriver
具有执行权限


右键单击你的应用程序,选择“显示软件包内容”。

Hi,你找到解决方案了吗?
driver_path = 'xxxx/chromedriver'  # path of your chromedriver
DATA_FILES = ['doi_list.txt', driver_path]