Good morning,
In this website 123pages, I would like to get content from every subpages that are linked to a specific result page (for example www.123pages.fr/c/alfortville/batiment-1/).
I’m going thru few issues with my actual version :
- The first page is skipped
- “address” (see below) grab me the full address while I only want the zip code
- It skips subpages from the list
- It grabs unwanted pages, like …/b/write-review/… while I only want detail pages
- The webpage indicate " 326 " results when my csv results only got " 146 "
Thanks in advance for any help!
John
function pageFunction(context) {
// called on every page the crawler visits, use it to extract data from it
var $ = context.jQuery;
if (context.request.label === "details") {
var result = {
adresse: $(".pagesjaunes .address").text(),
web: $(".pagesjaunes .weblink").text(),
email: $(".pagesjaunes .email").text()
};
return result;
} else {
context.skipOutput();
}
}