我想抓取以下石油价格网页:
https://www.shell.com.tr/motorists/shell-fuels/akaryakit-pompa-satis-fiyatlari.html
具有用于城市的下拉菜单选择器,我尝试了以下代码:
url <- "https://www.shell.com.tr/motorists/shell-fuels/akaryakit-pompa-satis-fiyatlari.html"
pgsession <- html_session(url)
pgform <-html_form(pgsession)[[1]]
filled_form <-set_values(pgform, q = "ISTANBUL")
d <- submit_form(session=pgsession,form=filled_form, POST=url)
y <- d %>% html_nodes("#cb_all_grdPrices_DXMainTable") %>% html_table(header=TRUE)
y
导致
> y
list()
,我无法正确获取城市价格。我怀疑html_nodes的CSS不正确?