Error 438 Object does not support ”with VBA-Selenium

Ben1312

New Member
Joined
Jun 3, 2019
Messages
2
[COLOR=#BBC0C4 !important][COLOR=#6A737C !important]0
<button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" title="This question does not show any research effort; it is unclear or not useful" aria-pressed="false" aria-label="down vote" data-selected-classes="fc-theme-primary" style="margin: 2px; box-sizing: inherit; font: inherit; position: relative; padding: 0px; border-width: initial; border-style: none; border-color: initial; border-radius: 3px; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; outline: none; box-shadow: none;">
<svg aria-hidden="true" class="svg-icon m0 iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36">
</path></svg>​
</button><button class="js-favorite-btn s-btn s-btn__unset c-pointer py8" aria-pressed="false" aria-label="favorite" data-selected-classes="fc-yellow-600" title="Click to mark as favorite question (click again to undo)" style="margin: 0px; box-sizing: inherit; font: inherit; padding: 0px; position: relative; border-width: initial; border-style: none; border-color: initial; border-radius: 3px; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; outline: none; box-shadow: none;">
<svg aria-hidden="true" class="svg-icon iconStar" width="18" height="18" viewBox="0 0 18 18">
</path></svg>
</button>
[/COLOR]
[/COLOR]
I am newbie and just try to finish my homework. I am trying to get the symbol, companyname, stock price from className by using VBA-Selenium in this website
https://www.barchart.com/stocks/ind...&orderBy=lastPrice&orderDir=asc&viewName=main
but I am still getting the error
"Run time error '438'object doesn't support this property or method" with the line of code mysheet.Cells(i, 1).Value = mytables.FindElementByClass("symbol text-left").Text. How should I resolve this problem? I already tried to install new patch of Selenium but it was not working.
There is another problem, that this page has 20 pages and I have to click each page to take the stock price. How can I do this? Please help this poor student.

Here is my code

[Public Sub Russelcrawler()

Dim driver As New WebDriver
Dim mytables As WebElements, table As WebElement, i As Integer, mysheet As Worksheet


With driver
.Start "IE", "https://www.barchart.com/stocks/indices/russell/russell2000?page=20&orderBy=lastPrice&orderDir=asc&viewName=main"
.Get "/"
End With




Set mysheet = Sheets("Russel")


Set mytables = driver.FindElementsByClass("bc-datatable")


i = 2
For Each table In mytables


mysheet.Cells(i, 1).Value = mytables.FindElementByClass("symbol text-left").Text
mysheet.Cells(i, 2).Value = mytables.FindElementByClass("symbolName text-left").Text
mysheet.Cells(i, 3).Value = mytables.FindElementByClass("lastPrice").Text


i = i + 1


Next






End Sub]

 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,214,784
Messages
6,121,538
Members
449,038
Latest member
Guest1337

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
Back
Top