I want to find and grab all the text given under a . Now it returns the text as well as the I want to learn the quickest way to too this, and format it by a comma.
now i alternatively code it by commanding to grab every separately. But i want to grab more then 20 items, so i want to find a quicker way. and also learn from it :D
I tried switching in find and find_all as well by adding get_text at the end. they all give a error
kenmerken = BeautifulSoup(browser.page_source, 'lxml')
details = kenmerken.find_all ('div', {'class':'detail-tab-content kenmerken'})
try:
tr = details[0].find_all ('td', {'class': 'value'})
except IndexError:
size_space = 'Unknown'
print(tr)
result:
[<td class="value">
Herenhuis
</td>, <td class="value">
2008
</td>, <td class="value">
250 m²
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
5
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
Ja
</td>, <td class="value">
-
</td>, <td class="value">
-
</td>, <td class="value">
Ja
</td>, <td class="value">
3.627
</td>, <td class="value">
64
</td>]
[
Aucun commentaire:
Enregistrer un commentaire