Open bereddy opened 1 year ago
You need to escape the space in the class. "YMlKec\ fxKbKc" Like this: curl -s -X 'GET' 'https://www.google.com/finance/quote/TCAP:BKK?hl=en'| htmlq div[class="YMlKec\ fxKbKc"] --text ฿50.00
Isn't that actually two selectors? I mean, last time I read the standard, 'class="foo bar"', was selecting both classes foo and bar, not a class with a space in its name.
So matching on both "class=foo" and "class=bar".
The stock quote in the HTML for this page,
https://www.google.com/finance/quote/TCAP:BKK
is within the following div :
If I try to extract the content of this div using
htmlq
and a command like:curl -X 'GET' 'https://www.google.com/finance/quote/TCAP:BKK?hl=en'| htmlq div[class="YMlKec fxKbKc"] --text
I get the following error:
After trying to extract the stock quote with
htmlq
using approaches that use the same selector, but in different ways, it's pretty clear to me thathtmlq
doesn't work right when the selector ID has a space in it.Or am I missing something?