Documentation
¶
Index ¶
- Constants
- func SetError(err error, msg any) error
- type ClickType
- type ClientBody
- func (p *ClientBody) CheckAdditionalCredentials(tel string) error
- func (p *ClientBody) ClickBtnLogin() error
- func (p *ClientBody) ClickBtnPass() error
- func (p *ClientBody) ClickBtnPost(isPost bool) error
- func (p *ClientBody) ClickBtnTel() error
- func (p *ClientBody) Close()
- func (p *ClientBody) InputFiles(with_file bool, files ...string) error
- func (p *ClientBody) InputID(usernameOrEmail string) error
- func (p *ClientBody) InputPassword(password string) error
- func (p *ClientBody) InputTel(tel string) error
- func (p *ClientBody) InputText(msg string) error
- func (p *ClientBody) IsThere(locate string) (bool, error)
- func (p *ClientBody) Login(username, password string, tel *string) error
- func (p *ClientBody) Post(isPost bool, sleepSecForUpload int, msg string, files ...string) error
- func (p *ClientBody) SetClickType(clickType ClickType) *ClientBody
- func (p *ClientBody) SetDefaultTimeout(sec int) *ClientBody
- func (p *ClientBody) SetWaitForInput(sec int) *ClientBody
- func (p *ClientBody) SetWaitForUpdateFile(sec int) *ClientBody
- func (p *ClientBody) ToLogin() error
- func (p *ClientBody) ToPost() error
- func (p *ClientBody) Wait(minWaitMillisec, ms int)
- type PostLocator
Constants ¶
View Source
const ( // /i/flow/login TWITTER = "https://twitter.com" TWITTERPRO = "https://pro.twitter.com" PATHHOME = "/home" PATHLOGIN = "/i/flow/login" // Login section INPUTID = "input[type='text']" BTNID = "xpath=//span[text()='次へ']" INPUTPASS = "input[type='password']" BTNPASS = "[data-testid='LoginForm_Login_Button']" INPUTTEL = "[data-testid='ocfEnterTextTextInput']" BTNTEL = "[data-testid='ocfEnterTextNextButton']" // Post section CONFIRMAREA = "[data-testid='tweetTextarea_0']" TOPOST = "div[aria-label='ポストを作成']" INPUTMSG = "[data-testid='tweetTextarea_0']" SELECTFILE = "input[data-testid='fileInput']" BTNPOST = "xpath=//span[text()='ポストする']" )
日本語指定のため、ラベル文字列は日本語になっています。 lang=en に変更することで、UIラベルは英語になります。
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientBody ¶
type ClientBody struct {
Pw *playwright.Playwright
Browser playwright.Browser
Context playwright.BrowserContext
Page playwright.Page
URL *url.URL
ClickType ClickType
PostLocator *PostLocator
MaxWaitSecForConfirmFIle int
MaxWaitSecForInput int
}
func New ¶
func New(isHeadless bool, useDevice *string) *ClientBody
func (*ClientBody) CheckAdditionalCredentials ¶
func (p *ClientBody) CheckAdditionalCredentials(tel string) error
CheckAdditionalCredentials 再確認のための電話番号入力画面が表示されているか確認する
func (*ClientBody) ClickBtnLogin ¶
func (p *ClientBody) ClickBtnLogin() error
ログインページで、ClickBtnLogin IDを入力後ボタンをクリック
func (*ClientBody) ClickBtnPass ¶
func (p *ClientBody) ClickBtnPass() error
ログインページで、ClickPassBtn パスワード入力後ボタンをクリック
func (*ClientBody) ClickBtnPost ¶
func (p *ClientBody) ClickBtnPost(isPost bool) error
投稿ページで、ClickBtnPost 投稿ボタンをクリック
func (*ClientBody) ClickBtnTel ¶
func (p *ClientBody) ClickBtnTel() error
ログインページで、ClickBtnTel 電話番号入力後ボタンをクリック
func (*ClientBody) Close ¶
func (p *ClientBody) Close()
func (*ClientBody) InputFiles ¶
func (p *ClientBody) InputFiles(with_file bool, files ...string) error
投稿ページで、InputFiles 投稿ファイルをアップロード
func (*ClientBody) InputID ¶
func (p *ClientBody) InputID(usernameOrEmail string) error
ログインページで、InputID ユーザー名/メールアドレスを入力 ID/Email/TEL入力欄となっている
func (*ClientBody) InputPassword ¶
func (p *ClientBody) InputPassword(password string) error
ログインページで、InputPassword パスワードを入力
func (*ClientBody) InputTel ¶
func (p *ClientBody) InputTel(tel string) error
ログインページで、InputTel 電話番号を入力
func (*ClientBody) InputText ¶
func (p *ClientBody) InputText(msg string) error
投稿ページで、InputText 投稿内容を入力
func (*ClientBody) SetClickType ¶
func (p *ClientBody) SetClickType(clickType ClickType) *ClientBody
func (*ClientBody) SetDefaultTimeout ¶
func (p *ClientBody) SetDefaultTimeout(sec int) *ClientBody
func (*ClientBody) SetWaitForInput ¶
func (p *ClientBody) SetWaitForInput(sec int) *ClientBody
func (*ClientBody) SetWaitForUpdateFile ¶
func (p *ClientBody) SetWaitForUpdateFile(sec int) *ClientBody
func (*ClientBody) Wait ¶
func (p *ClientBody) Wait(minWaitMillisec, ms int)
Wait 指定時間(ミリ秒)待機 minwaitmillsec引数を最低待機時間、ms引数を上限とした乱数msを追加し、待機
Click to show internal directories.
Click to hide internal directories.