Home > Blockchain >  VBA Excel Selenium- Use browser address bar for small temporary notes
VBA Excel Selenium- Use browser address bar for small temporary notes

Time:03-26

Good afternoon everyone,

Does anyone know how to put text in the Selenium Chrome Driver address bar that will serve as notes to select the best option without having to change the window looking for these notes?

example of intended

   Private gc As New Selenium.ChromeDriver

   Sub NotesInAdressBar()
   Dim ks As Selenium.Keys
   
   Set ks = New Selenium.Keys

    gc.AddArgument "start-maximized"
    gc.Start
    gc.Get "https://www.google.com"
    

end sub

I Try gc.Get "I want to put the notes here for temporary consultation!" but gives error PIC Err

CodePudding user response:

Try this:

Dim bot As WebDriver  'global keeps the Chrome window open...

Sub Test()
    Set bot = New Selenium.WebDriver
    bot.Start "chrome", "https://www.google.com"
    bot.Get "data:text/html,<h1>Hello World</h1>Some other text here.<br>And here"
End Sub

CodePudding user response:

You can always pass the desired text i.e. I want to put the notes here for temporary consultation! to Get as follows:

bot.Get "I want to put the notes here for temporary consultation!"
  • Related