2017-05-19 42 views
1

當我在azure上檢查我嘗試調用chrome驅動程序的自動化腳本時,它給了我下面的錯誤信息。腳本是在Python中。python腳本無法在azure上調用chrome驅動程序

[05/19/2017 11:36:19 > cbe7c6: INFO] step2 
[05/19/2017 11:36:19 > cbe7c6: ERR ] File "seleniumtest.py", line 21, in <module> 
[05/19/2017 11:36:19 > cbe7c6: ERR ]  driver = webdriver.Chrome(executable_path="D:\\home\\site\\wwwroot\\env\\chromeinstaller\\Chrome\\Application\\chrome.exe") 
[05/19/2017 11:36:19 > cbe7c6: ERR ] File "D:\home\site\wwwroot\env\Lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__ 
[05/19/2017 11:36:19 > cbe7c6: ERR ]  self.service.start() 
[05/19/2017 11:36:19 > cbe7c6: ERR ] File "D:\home\site\wwwroot\env\Lib\site-packages\selenium\webdriver\common\service.py", line 64, in start 
[05/19/2017 11:36:19 > cbe7c6: ERR ]  stdout=self.log_file, stderr=self.log_file) 
[05/19/2017 11:36:19 > cbe7c6: ERR ] File "D:\Python27\lib\subprocess.py", line 710, in __init__ 
[05/19/2017 11:36:19 > cbe7c6: ERR ]  errread, errwrite) 
[05/19/2017 11:36:19 > cbe7c6: ERR ] File "D:\Python27\lib\subprocess.py", line 958, in _execute_child 
[05/19/2017 11:36:19 > cbe7c6: ERR ]  startupinfo) 
[05/19/2017 11:36:19 > cbe7c6: ERR ] WindowsError: [Error 14001] The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail 
[05/19/2017 11:36:19 > cbe7c6: SYS INFO] Status changed to Failed 
[05/19/2017 11:36:19 > cbe7c6: SYS ERR ] Job failed due to exit code 1 

回答

0

根據你的錯誤信息,按我的經驗,我認爲你正在使用Azure的應用服務,試圖推動通過你上傳的webdriver鉻加載某些動態網頁內容中提取的東西。

然而,accoring到the restrictions of Azure Web App sandbox,你不能使用任何東西,這將調用GDI系統Azure上的Web應用程序。關於Windows錯誤,您可以參考here瞭解更多詳細信息。

作爲解決方法,我的建議是您可以嘗試在Azure VM上運行您的代碼。或者根據我的猜測,根據這個帖子的標籤,我想你可能想通過網絡驅動程序與chromedriver做一些網絡單元測試,請參閱here

相關問題