Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

Get nodes from a html webpage to crawl URLs using R

$
0
0

https://i.stack.imgur.com/xeczg.png

I am trying to get the URLs under the node '.2lines' from the webpage 'https://www.sgcarmart.com/main/index.php'

library(rvest)
url <- read_html('https://www.sgcarmart.com/main/index.php') %>% html_nodes('.2lines') %>% html_attr()

Which I receive an error for html_nodes function:

Error in parse_simple_selector(stream) : 
  Expected selector, got <NUMBER '.2' at 1>

How do I get around this error?


Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>