Feeds:
文章
留言

Archive for 十一月 28th, 2014

發生類似如下錯誤

File “subprocess.pyc", line 480, in call
File “subprocess.pyc", line 633, in __init__
File “subprocess.pyc", line 842, in _execute_child
WindowsError: [Error 2] 系統找不到指定的檔案。

解法

call() 加上 shell=True

 

參考資料

http://stackoverflow.com/questions/9531683/problems-using-subprocess-call-in-python-2-7-2-on-windows

Read Full Post »

py2exe 打包含有 PIL 程式時出現找不到 _imaging C module

需要手動將 _imaging.pyd, _imaging.dll 或 _imaging.so 手動加入

參考資料

http://effbot.org/zone/pil-imaging-not-installed.htm

Read Full Post »

Selenium Chrome 修改 UserAgent

今天需要自動化Chrome模擬mobile登入系統,Google許久終於找到解法,

1. Chrome Driver 要 2.12+

2. 使用 chrome_options

使用範例

參考資料

[1] http://simply-tutorial.com/blog/2014/07/10/selenium-webdriver-set-browsers-user-agent-and-proxy/

[2] https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation

[3] http://chromedriver.storage.googleapis.com/index.html

[4] https://realpython.com/blog/python/headless-selenium-testing-with-python-and-phantomjs/

[5] https://coderwall.com/p/9jgaeq/set-phantomjs-user-agent-string

 

Read Full Post »