Python 设置py2app以运行selenium
我在让py2app与使用Selenium的python webscraper程序一起工作时遇到问题 我知道我必须在我的软件包中加入硒元素,但没有任何效果。我看不到错误消息,因为.app无法打开 在我的python fie中的导入如下所示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
#! 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]