Guest User

How to scrape option values from select element

a guest
Jul 25th, 2016
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Sub selectscrape()
  2. Dim bot As New WebDriver, myselect As WebElement, options As WebElements, item As WebElement
  3. bot.Start "chrome", ""
  4. bot.Get "/filling-test-all-fields"
  5. Set myselect = bot.FindElementByName("40cc__type")
  6. Set options = myselect.FindElementsByTag("option")
  7. For Each item In options
  8. MsgBox (item.Text)
  9. Next
  10. End Sub
  11. 'credits -
RAW Paste Data