screenshots
parent
4afeb73732
commit
83cb49a158
|
@ -1,4 +1,4 @@
|
|||
USING: kernel http http.client http.server io.pathnames io.encodings.string io.encodings.utf8 io.launcher accessors urls parser effects.parser words arrays sequences quotations json.reader json.writer formatting assocs namespaces present hashtables words.symbol combinators lexer calendar prettyprint.backend ;
|
||||
USING: kernel http http.client http.server io.streams.byte-array io.pathnames io.encodings.binary io.encodings.string io.encodings.utf8 io.launcher accessors urls parser effects.parser words arrays sequences quotations json.reader json.writer formatting assocs namespaces present hashtables words.symbol combinators lexer calendar prettyprint.backend base64 images.png ;
|
||||
USING: prettyprint ;
|
||||
|
||||
IN: web-driver
|
||||
|
@ -257,6 +257,15 @@ TUPLE: rect x y width height ;
|
|||
: delete-all-cookies ( -- )
|
||||
"cookie" <session-delete-request> http-web-driver-request drop ;
|
||||
|
||||
! screen capture
|
||||
|
||||
: take-screenshot ( -- loading-png )
|
||||
"screenshot" <session-get-request> http-web-driver-request
|
||||
base64> binary <byte-reader> load-png ;
|
||||
|
||||
: take-element-screenshot ( element -- loading-png )
|
||||
"screenshot" <element-get-request> http-web-driver-request base64> binary <byte-reader> load-png ;
|
||||
|
||||
! TODO: handle driver processes better
|
||||
|
||||
: <chrome-driver-stream> ( url capabilities -- stream )
|
||||
|
|
Loading…
Reference in New Issue