2
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-12-21 13:23:02 +01:00

update selenium

This commit is contained in:
kev
2023-11-29 19:12:25 +08:00
parent 5e55c5868f
commit 33851c27c5

View File

@@ -21,6 +21,17 @@ $ selenium-standalone install
$ selenium-standalone start $ selenium-standalone start
``` ```
> To kill long-lived sessions:
```bash
ENDPOINT=127.0.0.1:4444
MAX_AGE=$((3*60)) # 3 minutes
curl -s "http://${ENDPOINT}/status" |
jq -r --arg age ${MAX_AGE} '.value.nodes[].slots[]|select(.session and (.session.start|sub("\\..*Z";"Z")|fromdateiso8601 < now-($age|tonumber))).session.sessionId' |
xargs -r -t -I {} curl -w '\n' -X DELETE "http://${ENDPOINT}/session/{}"
```
## Client ## Client
baidu-search.py baidu-search.py