79456582

Date: 2025-02-21 07:19:13
Score: 0.5
Natty:
Report link

Go to here:

https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/?cs=2626455528&form=MA13LH

Download the driver that matches your version of Edge. Extract and rename it from 'msedgedriver.exe' to 'edgedriver.exe'

Move the edgedriver.exe file to the following folder: C:\Users\YourName\AppData\Local\SeleniumBasic

Make sure you have a reference to Selenium in EXCEL or whatever program your using VBA with:

VBA Editor/Tools/References, look for and check: 'Selenium Type Library'

To start Selenium:

Add variable and assign at the very top of your VBA code below 'Option Explicit':

Option Explicit
Dim bot As New Selenium.EdgeDriver

In your VBA code add:

Sub buscarPreco()

 bot.Start
 bot.Get "your URL Here"
 bot.Wait 5000

 Dim myElementValue as String

 myElementValue = bot.FindElementById("price_inside_buybox").Attribute("innerText")

 If isnull(myElementValue) or myElementValue = "" then

   msgbox "No Element Value Found", vbInformation, "For Information..."

  else

   Cells(2, 2).Value = myElementValue 

 End if

 bot.Quit

End Sub
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Steven Wilson