'R How to scrap information of tweets on dynamic website?
I want to get information of tweets posted on the platform stocktwits.com.
On this platform, it is possible to send tweets about company shares. These are listed as a timeline.
For example, all tweets about Apple are listed here: https://stocktwits.com/symbol/AAPL
If you click on a tweet, the link to these tweets is now displayed in the browser bar. I would now like to automate the retrieval of the links to the tweets. In the next step I would like to go down one tweet at a time and copy this information.
Thus, I would like to copy the links to all tweets of a share.
However, I am not getting anywhere with my current approach:
library(rvest)
library(tidyverse)
"https://stocktwits.com/symbol/AAPL" %>%
read_html() %>%
html_nodes(".st_2o0zabc.st_jGV698i.st_PLa30pM") %>%
html_text()
I already fail at the first step to extract the link to the first tweet.
Likewise, I don't really know how to always go one tweet further in order to retrieve information on all tweets posted.
(Stocktwits.com also has an API, but it is not useful in my case.)
I hope that someone here can help me.
Many thanks in advance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
