Selenium / ChromeDrive / PHP base / Html CSS selector
Selenium
-
有多版本
- Python
- NodeJs
- Java
- Php
-
Selenium 需要 Browser 支援
- Chrome
- Firefox
-
而中間需要 Driver 控制
- Chrome
- Linux
- Mac
- Mac_M1
- Windows
- Firefox
- Chrome
-
而執行端需要 Chrome / Firefox
-
Linux
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm sudo yum install ./google-chrome-stable_current_*.rpm
-
Mac
- 我相信你有裝Chrome
-
-
執行Selenium 前必須啟動 Driver
- Mac/Linux
- ./chromedriver_mac –port=4444
- Mac/Linux
-
執行Selenium
-
若在Linux/Docker環境下須先執行變數定義
- ‘–disable-dev-shm-usage’
- docker上必備
- ‘–headless’
- 無畫面系統下必備
- ‘blink-settings=imagesEnabled=false’
- ‘–disable-gpu’
- ‘–no-sandbox’
- 無畫面系統下必備
- ‘–disable-dev-shm-usage’