0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Excel VBA + SeleniumBasic でサイボウズログイン、在席ステータスを取得

Posted at

環境

windows10
Excel(Office365)
Google Chrome ver 83.0.4103.106
SeleniumBasic ver 2.0.9.0
chromedriver ver 83.0.4103.39
サイボウズ試用版

サイボウズログイン、在席ステータスを取得

Sub 在席ステータスを取得する_Click()
    Dim Driver As New Selenium.WebDriver
    Dim seatStatus As String
    
    ' Chromeを開く
    Driver.Start "chrome"
    ' サイボウズを開く
    Driver.Get "https://XXXXXXX.cybozu.com/login"
    ' ログイン名を入力
    Driver.FindElementByXPath("//*[@id='username-:0-text']").SendKeys "sample@mail.com"
    ' パスワードを入力
    Driver.FindElementByXPath("//*[@id='password-:1-text']").SendKeys "XXXXXXXXXXXX"
    ' ログインボタンを押す
    Driver.FindElementByXPath("//*[@id='login-form-outer']/form/div[4]/div[2]/input").Click
    ' サイボウズofficeをクリック
    Driver.FindElementByXPath("/html/body/div[5]/div/div[1]/div/a[2]").Click
    ' 在席ステータスを取得する
    seatStatus = Driver.FindElementByXPath("//*[@id='cb7-portlet-body-110']/form/table/tbody/tr/td/table/tbody/tr/td[2]/a").Text
    ' セルに在席ステータスを書き込む
    Range("B3").Value = seatStatus
End Sub
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?