Scrape Element

The scrape element is an object which allows you to specify selectors, label and attribute to scrape. By default, the attribute scraped is the text content. The scrape element allows the fields listed below.


Fields

FieldTypeUsage
label requiredstringLabel used for describing your selected piece of data.
selector requiredstring || array<string>XPath selector value. Can be an array of selectors which allows you to select a parent and returns an array of children.
attribute optionalstringHTML attribute to use, by default uses text content of the element. An example can be the href attribute.

Example of a scrape element

{
"url": "https://remoteok.io",
"output": {
"jobs": [
{
"label": "job_title",
"selector": "//td//h2[@itemprop='title']"
},
{
"label": "company",
"selector": "//td//a[@class='companyLink']"
},
{
"label": "date_posted",
"selector": "//td[@class='time']//time",
"attribute": "datetime"
}
]
}
}