Question:
In R/rvest, as below code , I can run thehtml_text()
, but when i run want to get the linkage following every text web %>% html_node("div.p13n-desktop-grid") %>% html_attr(name='href')
failed .Anyone can help? Thanks!
Answer:
For (shortened) product links and link texts:There are 50 products per page but only first 30 are included in the grid, the rest would be loaded in small chunks as you’d scroll down. Unless descriptions are needed, it’s bit easier to just collect all IDs from
data-client-recs-list
and build links from those:If you have better answer, please add a comment about this, thank you!