作者yimean (温柔杀手)
看板Python
标题[问题] py2exe打包错误
时间Tue May 15 17:14:36 2018
各位版上的大大好
我使用py2exe打包程式出现一大堆错误,但是我在Spyder下执行是没有问题的。
烦请协助。
我的开发环境如下。
OS:windows 10
IDE:Anaconda Spyder 3
使用语法:Python 3
打包环境:anaconda prompt
有安装py2exe
资料夹名称:exe
资料夹容物:setup.py CheckinAndCheckout.py chromedriver.exe
py2exe.py的内容:
-------------------------------------------
from distutils.core import setup
import py2exe
setup(console=['CheckinAndChecout.py'])
--------------------------------------------
CheckinAndCheckout.py的内容
--------------------------------------------
import time
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Chrome()
driver.get("
https://pro.104.com.tw/hrm/psc/home.action")
driver.find_element_by_id("email").send_keys("
[email protected]")
driver.find_element_by_id("pwd").send_keys("2222222222222")
before_login_url=driver.current_url
driver.find_element_by_id("submit").click()
after_login_url=driver.current_url
if before_login_url == after_login_url:
print("unchanged")
else:
print("changed")
time.sleep(10)
right_click=driver.find_element_by_id("punchCardBtn")
ActionChains(driver).context_click(right_click).perform()
driver.quit()
----------------------------------------------
以下是编译过程中产生的错误讯息。
https://imgur.com/a/3N2p7XF
以上烦请指导,感谢。
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 113.196.183.168
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1526375678.A.A0C.html
1F:推 D0128431: 感觉像是某个传值过程 跟网页的是不一样 05/15 21:31
※ 编辑: yimean (113.196.183.168), 05/16/2018 09:52:54
※ 编辑: yimean (113.196.183.168), 05/16/2018 09:53:51
2F:→ yimean: 後来我使用Pyinstaller就成功了。看来跟工具是有很大关系 05/16 10:11