Feb-07-2017, 05:17 PM
thanks to your help i have been able to extract the data and export export everything to a csv file. Offcourse this now tasts like more and i would like to access the url's of the individual listings to extract more detailed info for each of the listings.
In the main source code this means i need to scrap this url for each of the listings (see blue)
</div>
</a>
</div>
<div class="search-result-content">
<div class="search-result-content-inner">
<div class="search-result-header">
<a href="/koop/rotterdam/huis-85488249-scottstraat-3/" data-search-result-item-anchor="85488249">
<h3 class="search-result-title">
Scottstraat 3
<small class="search-result-subtitle">
3076 GX Rotterdam
</small>
</h3>
</a>
</div> <div class="search-result-info search-result-info-price">
<span class="search-result-price">€ 165.000 k.k.</span>
</div>
<div class="search-result-info">
<ul class="search-result-kenmerken ">
<li>
<span title="Woonoppervlakte">67 m²</span>
/
<span title="Perceeloppervlakte">138 m²</span>
</li>
<li>3 kamers</li>
</ul>
</div>
I am using the code as posted by metulburr and added this line below "room"
As always, help is much appreciated!
In the main source code this means i need to scrap this url for each of the listings (see blue)
</div>
</a>
</div>
<div class="search-result-content">
<div class="search-result-content-inner">
<div class="search-result-header">
<a href="/koop/rotterdam/huis-85488249-scottstraat-3/" data-search-result-item-anchor="85488249">
<h3 class="search-result-title">
Scottstraat 3
<small class="search-result-subtitle">
3076 GX Rotterdam
</small>
</h3>
</a>
</div> <div class="search-result-info search-result-info-price">
<span class="search-result-price">€ 165.000 k.k.</span>
</div>
<div class="search-result-info">
<ul class="search-result-kenmerken ">
<li>
<span title="Woonoppervlakte">67 m²</span>
/
<span title="Perceeloppervlakte">138 m²</span>
</li>
<li>3 kamers</li>
</ul>
</div>
I am using the code as posted by metulburr and added this line below "room"
href = ad.find('a', {'class': 'search-result-header'}).link.get('href', {})but then i get the following error message:
Error: href = ad.find('a', {'class': 'search-result-header'}).link.get('href', {})
AttributeError: 'NoneType' object has no attribute 'get'
i have tried several things, for examplehref = 'www.funda.nl' + ad.find('a')but non-successful so far.
As always, help is much appreciated!