From 3605c31dc2784b98ed5a11ff5eb29c6aad9ef6a2 Mon Sep 17 00:00:00 2001 From: kev Date: Mon, 5 Feb 2018 16:01:39 +0800 Subject: [PATCH] add baidu-search.lua --- splash/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/splash/README.md b/splash/README.md index 53b5fcd..96509cd 100644 --- a/splash/README.md +++ b/splash/README.md @@ -54,6 +54,25 @@ $ docker-compose up -d ## client +```lua +-- baidu-search.lua + +function main(splash) + splash:go('https://www.baidu.com/') + splash:wait(1) + splash:select('#kw'):send_text('google') + splash:wait(1) + splash:select('#su'):click() + splash:wait(1) + splash:evaljs([[ + $('#content_left').css('padding', '0'); + ]]) + splash:set_viewport_full() + splash:wait(1) + return splash:select('#content_left'):png() +end +``` + ```lua -- youtube-logo.lua