boiled_bread
New Member
- Joined
- Jul 1, 2020
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Hi,
I am pretty much a newbie when it comes to VBA, but a family member asked me if I could write a script that web scrapes some basic information off of Outback Steakhouse. The link to the specific page is: Outback Steakhouse
My current issue is that when I try to select a state on the drop down menu on their locations directory in VBA, I can't seem to update the page to display the locations. The html code that I am working with is as follows:
Now I am pretty sure that the "ng-change" with "locations_update()" is what I want to trigger (I might be wrong), but I have tried a couple of things and they have not seemed to work.
This is the section of VBA code that I have been using to try to trigger a change so far
I realize that there is no "onchange" in the element, but at this point I am clueless on how to approach this. Any help would be appreciated. If anyone needs any more information to help me with this, [;ease let me know. Thanks!
I am pretty much a newbie when it comes to VBA, but a family member asked me if I could write a script that web scrapes some basic information off of Outback Steakhouse. The link to the specific page is: Outback Steakhouse
My current issue is that when I try to select a state on the drop down menu on their locations directory in VBA, I can't seem to update the page to display the locations. The html code that I am working with is as follows:
Rich (BB code):
<select id="mainContent" tabindex="0" ng-options="obj.state for obj in locationStates track by obj.id" aria-label="Select a state"
ng-model="selectedLocation" ng-change="locations_update()" class="ng-pristine ng-valid ng-empty ng-touched" aria-invalid="false" style="">
<option value="?" selected="selected"></option>
<option label="ALABAMA" value="0">ALABAMA</option>
<option label="ALASKA" value="1">ALASKA</option>
<option label="ARIZONA" value="2">ARIZONA</option>
<option label="ARKANSAS" value="3">ARKANSAS</option>
<!--etc...-->
</select>
Now I am pretty sure that the "ng-change" with "locations_update()" is what I want to trigger (I might be wrong), but I have tried a couple of things and they have not seemed to work.
This is the section of VBA code that I have been using to try to trigger a change so far
VBA Code:
Dim SearchBar As Object
Set IE = CreateObject("InternetExplorer.Application")
...
Set SearchBar = IE.document.getElementById("mainContent")
SearchBar.Focus
SearchBar.selectedIndex=2
SearchBar.FireEvent ("onchange")
I realize that there is no "onchange" in the element, but at this point I am clueless on how to approach this. Any help would be appreciated. If anyone needs any more information to help me with this, [;ease let me know. Thanks!