2023-05-12 20:04:04 +02:00
|
|
|
open Pusk.Utils
|
2023-05-13 10:15:35 +02:00
|
|
|
open Pusk.Net
|
|
|
|
open Pusk.Drivers
|
2023-05-12 19:36:27 +02:00
|
|
|
|
2023-05-13 10:15:35 +02:00
|
|
|
let main =
|
|
|
|
let json_payload =
|
|
|
|
{|
|
|
|
|
{
|
|
|
|
"capabilities": {
|
|
|
|
"alwaysMatch": {
|
|
|
|
"moz:firefoxOptions": {
|
|
|
|
"args": ["-headless"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|}
|
|
|
|
in
|
|
|
|
let body = send_post_request "http://localhost:4444/session" json_payload in
|
|
|
|
print_endline (Lwt_main.run body)
|
|
|
|
;;
|
2023-05-12 20:30:02 +02:00
|
|
|
|
2023-05-12 19:36:27 +02:00
|
|
|
let () =
|
2023-05-13 10:15:35 +02:00
|
|
|
let driver = prepare (Gecko "0.33.0") in
|
|
|
|
let driver_pid = run driver [] in
|
|
|
|
print_endline (fmt "Driver running as %d" driver_pid);
|
2023-05-13 10:39:51 +02:00
|
|
|
main
|
2023-05-12 19:36:27 +02:00
|
|
|
;;
|