【一般的なコード】(VBA)
Sub サイト開く()
Dim URL1 As String
Dim driver As New Selenium.WebDriver
driver.Start "chrome"
URL1 = "https://www.google.com/"
driver.Get URL1
Stop 'ここで一時停止
driver.Close
End Sub
1Sub test()
234 Dim Driver As New Selenium.WebDriver
56 With Driver
7 .SetCapability "pageLoadStrategy", "none"
89 .Start "chrome"
10 .Get "https://www.google.com/"
11 End With
121314 CUR_URL = Driver.Url
1516 MsgBox CUR_URL
171819End Sub
② 【vba selenium options chrome】をググる ヘッドレス ChromeをSeleniumBasicで動かしてみました ... で
「以前書いた記事では、.Net用のSeleniumを使い「ChromeOptions」でヘッドレスモードを指定したのですが、SeleniumBasicではChromeOptionsが用意されていないようです。
どうすれば良いのか一瞬迷いましたが、「AddArgument」で普通にヘッドレス用のオプションを指定すれば良いようです。」
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Capabilities & ChromeOptions - WebDriver for Chrome で
「Recognized capabilities
Please see Selenium documentation and W3C WebDriver standard for standard capabilities accepted by ChromeDriver. Here we only list Chrome-specific capabilities.
ChromeOptions object
Most Chrome-specific capabilities are exposed through the ChromeOptions object. In some languages, this is implemented by the ChromeOptions class. In other languages, they are stored under the goog:chromeOptions dictionary in desired capabilities.」
と
【Ruby】コードの
「caps = Selenium::WebDriver::Remote::Capabilities.chrome(
"goog:chromeOptions" => {"args" => [ "window-size=1000,800" ]})
driver = Selenium::WebDriver.for :chrome, desired_capabilities: caps」から
「AddArgument」と「desired_capabilities」が
キーワードとなるのではないかと 推測
③ VBEで
Dim Driver As New Selenium.WebDriver
Driver
と入力し、次に ピリオドを打鍵
すると
入力候補一覧が 表示されるので
スクロールして 確認
ここでは
【AddArgument】 と 【SetCapability】
が 使えそうではないかと 目星を付ける