I'm Sorry, I tried, Up/Down Arrows

I keep trying to pull data off of Rankings I'm able to get all the fields I'm hoping for except the arrows, I'm guessing because the arrows aren't actually "text"? such as this ↑ or ↓?

Unfortunately I'm left with just percentages without knowing if its positive or negative, which, as you can imagine, can greatly alter the results.

Any Ideas?

want to provide link to site ?

Hello drearystate,

Thanks for the reply, I very much appreciate it :slightly_smiling_face:

The link should be under the "Rankings" hyperlink. Maybe the link was blocked on my post.

The full URL is: https:// stocktwits. com/rankings/trending

Thank you very much.

Any other ideas? I'm so close! ):

@Ditto Hello, it appears that the arrow identifiers are icon svg elements.

To identify the price change you can extract the path attribute and simply replace this value with 'up' or 'down' value using the 'Regex match' & 'Replace text' parsers in Web Scraper Cloud - Parser | Web Scraper Documentation.





Example:

{"_id":"stocktwits-com","startUrl":["https://stocktwits.com/rankings/trending"],"selectors":[{"id":"wrapper","multiple":true,"parentSelectors":["_root"],"selector":"tbody tr","type":"SelectorElement"},{"id":"symbol","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"a","type":"SelectorText"},{"id":"change","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"td:nth-of-type(6)","type":"SelectorText"},{"extractAttribute":"d","id":"arrow-value-up","multiple":false,"parentSelectors":["wrapper"],"selector":"path[d*=\"m 219.11393,173.74781 -49.85324,68.86017\"]","type":"SelectorElementAttribute"},{"extractAttribute":"d","id":"arrow-value-down","multiple":false,"parentSelectors":["wrapper"],"selector":"path[d*=\"M 219.09704,338.21059 V 18.27301\"]","type":"SelectorElementAttribute"}]}

1 Like