mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-22 17:45:40 +03:00
[ParuVenduImmo] fix: try to repair broken css selectors (#2641)
* [ParuVenduImmo] fix: try to repair broken css selectors Needs more work.
This commit is contained in:
parent
b6e8350596
commit
57c8806954
1 changed files with 15 additions and 4 deletions
|
@ -28,7 +28,9 @@ class ParuVenduImmoBridge extends BridgeAbstract {
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
$html = getSimpleHTMLDOM($this->getURI());
|
$html = getSimpleHTMLDOM($this->getURI());
|
||||||
|
|
||||||
foreach($html->find('div.annonce a') as $element) {
|
$elements = $html->find('#bloc_liste > div.ergov3-annonce a');
|
||||||
|
|
||||||
|
foreach($elements as $element) {
|
||||||
|
|
||||||
if(!$element->title) {
|
if(!$element->title) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -41,10 +43,19 @@ class ParuVenduImmoBridge extends BridgeAbstract {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$desc = $element->find('span.desc')[0]->innertext;
|
$description = $element->find('p', 0);
|
||||||
$desc = str_replace("voir l'annonce", '', $desc);
|
if ($description) {
|
||||||
|
$desc = str_replace("voir l'annonce", '', $description->innertext);
|
||||||
|
} else {
|
||||||
|
$desc = '';
|
||||||
|
}
|
||||||
|
|
||||||
$price = $element->find('span.price')[0]->innertext;
|
$priceElement = $element->find('div.ergov3-priceannonce', 0);
|
||||||
|
if ($priceElement) {
|
||||||
|
$price = $priceElement->innertext;
|
||||||
|
} else {
|
||||||
|
$price = '';
|
||||||
|
}
|
||||||
|
|
||||||
list($href) = explode('#', $element->href);
|
list($href) = explode('#', $element->href);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue