Hi,
So i have been searching hundreds of forum threads for an answer to this, but its been convoluted due to the website layout that i am working with.
I have code that goes to a website and needs to click on a button, but the button doesnt seem to have the same labels that i normally see in HTML.
here are the html attributes i have been scanning through to figure out how to call the button to click it with VBA controls.
<button data-onboarding="new-object-button" data-selenium-test="new-object-button" type="button" aria-disabled="false" class="btn uiButton private-button private-button--default private-button--primary btn-primary add-obj" tabindex="0"><!-- react-text: 9679 -->Add contact<!-- /react-text --></button>
" button data-onboarding="new-object-button" data-selenium-test="new-object-button" type="button" aria-disabled="false" class="btn uiButton private-button private-button--default private-button--primary btn-primary add-obj" tabindex="0"><!-- react-text: 9679 -->Add contact<!-- /react-text -->
some additional html associated with this button:
div class="m-left-3 UIColumn-content"><div class="add-control"
I dont know if it has something to do with Selenium (which i dont use and not samilar with).
Here is the macro that i have been attempting to play with.
my issue is that i cant figure out how to use the right command to click the button (there doesnt seem to be a proper ID).
any help would be greatly appreciated!!!
pretty please.</div>
So i have been searching hundreds of forum threads for an answer to this, but its been convoluted due to the website layout that i am working with.
I have code that goes to a website and needs to click on a button, but the button doesnt seem to have the same labels that i normally see in HTML.
here are the html attributes i have been scanning through to figure out how to call the button to click it with VBA controls.
<button data-onboarding="new-object-button" data-selenium-test="new-object-button" type="button" aria-disabled="false" class="btn uiButton private-button private-button--default private-button--primary btn-primary add-obj" tabindex="0"><!-- react-text: 9679 -->Add contact<!-- /react-text --></button>
" button data-onboarding="new-object-button" data-selenium-test="new-object-button" type="button" aria-disabled="false" class="btn uiButton private-button private-button--default private-button--primary btn-primary add-obj" tabindex="0"><!-- react-text: 9679 -->Add contact<!-- /react-text -->
some additional html associated with this button:
div class="m-left-3 UIColumn-content"><div class="add-control"
I dont know if it has something to do with Selenium (which i dont use and not samilar with).
Here is the macro that i have been attempting to play with.
my issue is that i cant figure out how to use the right command to click the button (there doesnt seem to be a proper ID).
Code:
Sub FillInBBCSearchForm()
'Make sure you've set a reference to the
'Microsoft Internet Controls object library first
'create a variable to refer to an IE application
Dim ieApp As New SHDocVw.InternetExplorer
'make sure you can see this new copy of IE!
ieApp.Visible = True
'go to the website of interest
ieApp.Navigate "https://app.hubspot.com/sales/xxxxxxx/contacts/list/view/all/?"
Do While ieApp.Busy
DoEvents
Loop
'wait for page to finish loading
Do While ieApp.Busy And Not ieApp.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
'wait for page to finish loading
Do While ieApp.Busy And Not ieApp.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Application.Wait (Now + #12:00:05 AM#)
'ieApp.Document.all.Item("search").Value = "bob"
'click on the search button
ieApp.Document.all("button").Click
End Sub
any help would be greatly appreciated!!!
pretty please.</div>