• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home » Resolved: In R/rvest, how to get href information ( the linkage following click text)

Resolved: In R/rvest, how to get href information ( the linkage following click text)

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

In R/rvest, as below code , I can run the html_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!
enter image description here

Answer:

For (shortened) product links and link texts:
Created on 2022-06-16 by the reprex package (v2.0.1)
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:
Created on 2022-06-17 by the reprex package (v2.0.1)

If you have better answer, please add a comment about this, thank you!

r rvest
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How can I copy files using the ansible.builtin.copy module and avoid conflicting file names?

26/03/2023

Resolved: Reshape tensors of unknown shape with tf.function

26/03/2023

Resolved: Use Svelte Component as Slot

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.