Launch two independent Chrome instances: one normal, one with remote debugging on port 9222.
# Step 1: Kill Chrome
taskkill /F /IM chrome.exe /T 2>$null
Start-Sleep -Seconds 2
# Step 2: Normal Chrome
Start-Process "C:\Program Files\Google\Chrome\Application\chrome.exe"
# Step 3: Debug Chrome (after 2s)
Start-Sleep -Seconds 2
Start-Process "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList '--remote-debugging-port=9222', '--user-data-dir=C:\selenum\ChromeProfile'
# Step 1: Kill Chrome
pkill -f "Google Chrome" 2>/dev/null; sleep 2
# Step 2: Normal Chrome
open -a "Google Chrome"
# Step 3: Debug Chrome (after 2s)
sleep 2
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9222 \
--user-data-dir="$HOME/selenium/ChromeProfile" &
http://localhost:9222共 2 个版本