Hello Everyone,
I have a problem with rvest. I am trying to scrap a dropdown list based on previous choise from other dropdown list. Here is the problem:
from this webpage -> https://www.otomoto.pl/osobowe/volkswagen/"
I want to extract all the car models that belongs to volkswagen for example using html_nodes() and XPath
//[@id="param571"]/option <- XPath for car brands (BMW, Audi, Volkswagen etc.)
//[@id="param573"]/option <- XPath for car models ( only Volkswagen models etc.)
For the brands works perfect but with models it doesn't at all resoults:
character(0)
Code I used:
brand <- read_html("https://www.otomoto.pl/osobowe/volkswagen/")
modelsv2 <- html_nodes(brand, xpath = '//*[@id="param573"]/option') %>%
html_text()
modelsv2
Much apprecieted for any help I am fighting with this over a week! Thanks