You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thread 'main' panicked at 'Failed to parse CSS selector: ()', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/htmlq-0.4.0/src/main.rs:248:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
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 that htmlq doesn't work right when the selector ID has a space in it.
Or am I missing something?
The text was updated successfully, but these errors were encountered:
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".
Moreover, an ID (per the title) should never have spaces. That's not to say that someone hasn't foolishly created HTML with spaces in the ID attribute, but it's counter to the standard.
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?
The text was updated successfully, but these errors were encountered: