mercredi 3 novembre 2021

How to get the text of div class?

#Days

        try:
            days2.append(link2.find_all('div',{'class':'list-card variable-text list-card-img-overlay'}).text)
        except Exception:
            days2.append('N/A')

#Views

        try:
            views.append(link2.find_all('div',{'class':'Text-c11n-8-53-2__sc-aiai24-0 duChdW'}[2]).text)
        except Exception:
            views.append('N/A')

https://www.zillow.com/manhattan-new-york-ny-10023/?searchQueryState=%7B%22pagination%22%3A%7B%7D%2C%22usersSearchTerm%22%3A%2210023%22%2C%22mapBounds%22%3A%7B%22west%22%3A-73.9951494604187%2C%22east%22%3A-73.9682415395813%2C%22south%22%3A40.763770638446054%2C%22north%22%3A40.7898340773195%7D%2C%22regionSelection%22%3A%5B%7B%22regionId%22%3A61637%2C%22regionType%22%3A7%7D%5D%2C%22isMapVisible%22%3Atrue%2C%22filterState%22%3A%7B%22ah%22%3A%7B%22value%22%3Atrue%7D%7D%2C%22isListVisible%22%3Atrue%2C%22mapZoom%22%3A15%7D enter image description here

enter image description here

enter image description here

keep getting N/A instead of 2hours and 88views




Aucun commentaire:

Enregistrer un commentaire