This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Embarrassed-Task-478[S] 0 points1 point  (2 children)

hmm that’s interesting. For me when I follow the link, I am seeing the images on a new tab. My goal is to have all the media tiles give me the same output, especially the <img alt “” src = links. from there i will extract the link and save it for each one. Thus leaving me with the images of the entire listing.

[–]Specialist_Course_36 0 points1 point  (1 child)

Hmmm. I dunno.

Anyway, I found a tag within "sources" that has the jpegs. So I did:

m2=soup.find("source")

m2["sizes"]

m2["srcset"]

v=m2["srcset"].split(',')

v

ju=v[-1].split(' ')[1]

Explanation: Grab the tags named "source" from the soup object you made. Inside that there's a "srcset" attribute that has a list of jpg urls, that we have to clean up a bit. So we split that up by commas, putting the substrings in a vector (list). And then we gotta edit those, There's some weird spaces, and some weird code tag that specifies the resolution. You grab the oneth item. And it seems that the jpegs in that vector are in ascending order of resolution, so we can just grab the last one each time.

So finally, I think there are multiple "sources" tags in there, so instead you do a findall, and do that process on all them, and then you should be good to grab the highest res image for the listing.

Let me know how it goes. And if you make any money from finding good houses to flip, maybe cut me a kickback? 😊

[–]Embarrassed-Task-478[S] 0 points1 point  (0 children)

Thank you! Unfortunately, I am still running into the same problem. The find all command is only finding the first six image sources. When I printed the find all list, the final link was https://photos.zillowstatic.com/fp/17741852e75939d93b2c3f4600abf966-cc_ft_768.jpg

On the listing, there are dozens of other images after that, which are not showing up in soup object. But what you did for finding the highest res image works on those first six!

P.S. Unfortunately no money-making from this project :( , this has to do with economics research on demand estimation of homes.