我应该如何在网站上抓取该网站上的所有位置:';https://shoppers.instacart.com/instacart-jobs'

我应该如何在网站上抓取该网站上的所有位置:';https://shoppers.instacart.com/instacart-jobs',r,web-scraping,rvest,R,Web Scraping,Rvest,我的目标是将Insta Cart运行的每一个位置都记录到excel电子表格中,而不是手动输入每个城市和州 这是我的R代码: #install.packages('robotstxt') library(rvest) library(tidyverse) library(robotstxt) #RobotTxts to see if able to scrub data paths_allowed(paths = c('https://shoppers.instacart.com/instaca

我的目标是将Insta Cart运行的每一个位置都记录到excel电子表格中,而不是手动输入每个城市和州

这是我的R代码:

#install.packages('robotstxt')
library(rvest)
library(tidyverse)
library(robotstxt)

#RobotTxts to see if able to scrub data
paths_allowed(paths = c('https://shoppers.instacart.com/instacart-jobs'))

# Reading html texts from website
insta_cart <- read_html('https://shoppers.instacart.com/instacart-jobs') 
print(insta_cart)
输出:NA


您知道我做错了什么,或者对疑难解答有什么见解吗?

尝试提取“stateJobsPageUrl,例如,“stateJobsPageUrl:”,然后从stateJobsPageUrl链接(“cityJobsPageUrl:”)提取“cityJobsPageUrl”。基本上,您需要在2个级别上执行抓取,因此我正在尝试使用html_节点(stateJobsPageUrl)提取数据,它正在拉起NA。你知道我是如何从stateJobsPageUrl中提取的吗
insta_cart %>%
  html_node(".state-collection") %>%
  html_text()