I have got an assignment to capture all apple stock history values in table. Link is this -https://finance.yahoo.com/quote/AAPL/history/
On inspecting table section, it is covered by this
class="Pb(10px) Ovx(a) W(100%)" data-reactid="32"
As you can see, class name above contains lot of spaces therefore I need to come up with something like this .Pb(10px).Ovx(a).W(100%) tr
It works well when I use this string directly in chrome page [inspect elements->ctrl+F->copy above string) therefore used in my code like this (inspired from official documentation https://webdriver.io/docs/api/element/getText.html to get data from table) -
const rows=$$('.Pb\(10px\).Ovx\(a\).W\(100\%\) tr');
const C1 =rows[1].$$('td');
const D1=C1[3].getText();
unfortunately, I get following error on running js code via webdriverio
[0-0] 2020-12-24T20:06:47.791Z INFO webdriver: COMMAND findElements("css selector", ".Pb(10px).Ovx(a).W(100%) tr")
[0-0] 2020-12-24T20:06:47.792Z INFO webdriver: [POST]
http://localhost:9515/session/a6e01e59fd6304b8d56fb3360ac78ab3/elements
2020-12-24T20:06:47.792Z INFO webdriver: DATA { using: 'css selector', value: '.Pb(10px).Ovx(a).W(100%) tr' }
[0-0] 2020-12-24T20:06:47.824Z WARN webdriver: Request failed with status 400 due to invalid selector: An invalid or illegal selector was specified
(Session info: chrome=87.0.4280.88)
Tried many options, need advice from exerts :)