WIP Fake vip ads.
This commit is contained in:
@@ -183,7 +183,19 @@ class ProstorCrawler {
|
|||||||
async scrapeAd(realEstate) {
|
async scrapeAd(realEstate) {
|
||||||
const { lat, lng, property_name, price, size, link, status } = realEstate;
|
const { lat, lng, property_name, price, size, link, status } = realEstate;
|
||||||
|
|
||||||
//console.log("[PROSTOR] Scraping : ", url);
|
//Status information is given already in realestate list
|
||||||
|
//For VIP Ads status ='' canot be used, but also area='0' we will use that temporary
|
||||||
|
//It is weird because yesterday it said 'VIP ponuda' ???
|
||||||
|
const adStatus =
|
||||||
|
size === "0"
|
||||||
|
? ProstorCrawler.getStatusId("VIP ponuda")
|
||||||
|
: ProstorCrawler.getStatusId(status);
|
||||||
|
//
|
||||||
|
console.log("adStatus", adStatus);
|
||||||
|
|
||||||
|
const url = `https://prostor.ba${link}`;
|
||||||
|
|
||||||
|
// console.log("[PROSTOR] Scraping : ", url);
|
||||||
try {
|
try {
|
||||||
const adPageSource = await fetch(url);
|
const adPageSource = await fetch(url);
|
||||||
const body = await adPageSource.text();
|
const body = await adPageSource.text();
|
||||||
@@ -330,7 +342,6 @@ class ProstorCrawler {
|
|||||||
furnishingType = FURNISHING_TYPE.NOT_FURNISHED.id;
|
furnishingType = FURNISHING_TYPE.NOT_FURNISHED.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
const adStatus = ProstorCrawler.getStatusId(status);
|
|
||||||
const title = property_name;
|
const title = property_name;
|
||||||
const parsedPrice = parseFloat(price.replace(/\./g, "")) || null;
|
const parsedPrice = parseFloat(price.replace(/\./g, "")) || null;
|
||||||
const parsedArea = parseFloat(size);
|
const parsedArea = parseFloat(size);
|
||||||
@@ -539,6 +550,8 @@ class ProstorCrawler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static getStatusId(statusText) {
|
static getStatusId(statusText) {
|
||||||
|
//
|
||||||
|
console.log("statusText u funkciji", statusText);
|
||||||
switch (statusText) {
|
switch (statusText) {
|
||||||
case "":
|
case "":
|
||||||
return AD_STATUS.STATUS_NORMAL;
|
return AD_STATUS.STATUS_NORMAL;
|
||||||
|
|||||||
@@ -32,6 +32,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
document.getElementById("realEstateUrl").click();
|
//document.getElementById("realEstateUrl").click();
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user