web scraping in r with SelectorGadget
تبليغيرجى شرح بإيجاز لمإذا تشعر أنك ينبغي الإبلاغ عن هذا السؤال.
I was running this simple code below to scrape the employee number from this Fortune 500 page. I used SelectorGadget to identify that the number I want matches with “.info__row–7f9lE:nth-child(13) .info__value–2AHH7”
library(rvest)
library(dplyr)
#download google chrome extention: SelectorGadget
link = “https://fortune.com/company/walmart/”
page = read_html(link)
Employees = page %>% html_nodes(“.info__row–7f9lE:nth-child(13) .info__value–2AHH7”) %>% html_text()
Employees
However, it returned “character(0)”. Does anyone know what is the cause? I feel it must be a simple mistake somewhere. Thanks in advance!
أضف إجابة