I'm using
print(d.contents)
My print loop prints the following ResultSets
:
[<a href="Property.aspx?pi=cd1a0b90-07aa-ec11-aa4c-246e960cbc4d" title="3 Bedroom House For Sale In Anthoupoli, Nicosia">3 Bedroom House For Sale In Anthoupoli, Nicosia</a>]
[<a href="Property.aspx?pi=c42dc379-5f67-e811-bb4e-a4badb3ceace" title="2 Storey Modern 3 Bedroom House For Sale In Dali Area">2 Storey Modern 3 Bedroom House For Sale In Dali Area</a>]
[<a href="Property.aspx?pi=6370763d-61ab-e811-b319-a4badb3ceacd" title="Very Nice And Spacious 3 Bedroom Detached House For Sale In Lakatamia">Very Nice And Spacious 3 Bedroom Detached House For Sale In Lakatamia</a>]
[<a href="Property.aspx?pi=7da50193-266b-e811-bb4e-a4badb3ceace" title="3 Bedroom Under Construction Detached 4 Houses For Sale In Tseri Area">3 Bedroom Under Construction Detached 4 Houses For Sale In Tseri Area</a>]
[<a href="Property.aspx?pi=96d0fb0a-89bd-ec11-aa4e-246e960cbc4d" title="3 Bedroom House For Sale In Agios Dometios, Nicosia">3 Bedroom House For Sale In Agios Dometios, Nicosia</a>]
[<a href="Property.aspx?pi=1881b78e-52d7-ec11-aa4e-246e960cbc4d" title="4 Bedroom House For Sale In Archangelos, Nicosia">4 Bedroom House For Sale In Archangelos, Nicosia</a>]
[<a href="Property.aspx?pi=eaa2b630-e685-ec11-aa4c-246e960cbc4d" title="In Excellent Location 3 Bedrooms House In Archangelos Nicosia">In Excellent Location 3 Bedrooms House In Archangelos Nicosia</a>]
[<a href="Property.aspx?pi=2ad40da2-a190-ec11-aa4c-246e960cbc4d" title="Incomplete residential development in Politiko, Nicosia">Incomplete residential development in Politiko, Nicosia</a>]
[<a href="Property.aspx?pi=a19ad42e-cd59-e911-8b16-a4badb3ceacd" title="3 Bedroom House For Sale In Spilia With Great View">3 Bedroom House For Sale In Spilia With Great View</a>]
How can I print only the values of href
attribute?
I noticed that using
print(d.text)
gives me only the titles, but I want the URLs instead.