Documentation
¶
Index ¶
- Constants
- func CaptureScreen(screenShotName, loginFlag string, sleep int64, screenShot *ScreenShotValue) chromedp.Action
- func ElementScreenShot(sel string, res *[]byte) chromedp.Tasks
- func FullScreenShot(quality int64, screenShotName, loginFlag string, sleep int64, ...) chromedp.Tasks
- func Message(ev interface{})
- func SaveScreenShot(path string, screenShot *ScreenShotValue)
- type Browser
- type ScreenShotValue
Constants ¶
View Source
const ( TimeZone = "Asia/Shanghai" UserAgentForChrome = `Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36` )
Chrome相关
Variables ¶
This section is empty.
Functions ¶
func CaptureScreen ¶
func CaptureScreen(screenShotName, loginFlag string, sleep int64, screenShot *ScreenShotValue) chromedp.Action
抓图
func ElementScreenShot ¶
elementScreenshot takes a screenshot of a specific element.
func FullScreenShot ¶
func FullScreenShot(quality int64, screenShotName, loginFlag string, sleep int64, screenShot *ScreenShotValue) chromedp.Tasks
FullScreenShot takes a screenshot of the entire browser viewport.
Liberally copied from puppeteer's source.
Note: this will override the viewport emulation settings.
Types ¶
type Browser ¶
type Browser struct {
// contains filtered or unexported fields
}
func (*Browser) NewContext ¶
func (brow *Browser) NewContext() (context.Context, context.CancelFunc)
NewContext 在浏览器中tab可以使用context产生
type ScreenShotValue ¶
func NewCaptureScreenShot ¶
func NewCaptureScreenShot(ScreenShot bool) *ScreenShotValue
Click to show internal directories.
Click to hide internal directories.