IE VBA web scrapping

Eriasu

New Member
Joined
Jan 17, 2021
Messages
6
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi everyone!

So far with your help I have managed to select from the combobox but the username fields do not show up (if you change options from the combobox on the website, username and password inputboxes appear). How do I trigger this step in VBA?

See code below:

Option Explicit
Const sWebPage = "https://analytics.emea.teleperformance.com/ibmcognos/bi/"
Sub IEBot()

Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

IE.navigate sWebPage

Do While IE.ReadyState <> READYSTATE_COMPLETE
Loop

Dim oHDoc As htmlDocument
Set oHDoc = IE.document

Dim oHEle As HTMLSelectElement

Do
Set oHEle = oHDoc.getElementsByName("CAMNamespace")(0)
DoEvents
Loop While oHEle Is Nothing

oHEle.selectedIndex = 0

End Sub
 

Some videos you may like

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Watch MrExcel Video

Forum statistics

Threads
1,128,126
Messages
5,628,858
Members
416,345
Latest member
sayad

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top