Guest User

How to scrape option values from select element

a guest
Jul 25th, 2016
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.39 KB | None | 0 0
  1. Public Sub selectscrape()
  2. Dim bot As New WebDriver, myselect As WebElement, options As WebElements, item As WebElement
  3. bot.Start "chrome", "http://www.roboform.com"
  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 - codingislove.com
Add Comment
Please, Sign In to add comment