This R package enables you to web scrape an individual marktplaats advertisement or all advertisements related to a search query. If you want to analyse your own advertisements, you could consider the official Marktplaats API.
devtools::install_github("timvink/mpscraper")
list_advertisements(url)
: Scrapes a given markplaats search url and returns the list of advertisements (incl ad_id) for all search result pages.scrape_advertisement(ad_id)
: Collects a set of features from a given advertisement idscrape_ads(ad_ids)
: Collects a set of features from a vector of advertisement idsscrape_adv_images(ad_id)
: Collects the available images for a single advertisement id# Get all advertisements for a certain search query
url <- "http://www.marktplaats.nl/z/telecommunicatie/mobiele-telefoons-apple-iphone/iphone.html?query=iphone&categoryId=1953&sortBy=SortIndex"
ads <- list_advertisements(url, advertisement_type = "individuals", max_pages = 5)
# Build a dataset with the details from all the adds
all_ad_data <- scrape_ads(ads$ad_id)
Note that you can find the URL of an ad using the id: http://www.marktplaats.nl/<id>
.
Some ideas:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.