Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrape photo URLs #40

Open
lkdmid opened this issue Jun 11, 2022 · 4 comments
Open

Scrape photo URLs #40

lkdmid opened this issue Jun 11, 2022 · 4 comments

Comments

@lkdmid
Copy link

lkdmid commented Jun 11, 2022

It'd be pretty handy to return a list of property photo URLs, or at least the primary/featured photo URL, e.g: https://media.rightmove.co.uk/64k/63334/85611534/63334_11482068_IMG_00_0000.jpeg

@toby-p
Copy link
Owner

toby-p commented Jun 16, 2022

Agreed could be interesting. I don't have the bandwidth to look at this right now but if you want to submit a PR I could review and merge.

@williamy2k
Copy link

I'd be interested in this, I'll take a look at it at some point and see if I can submit a PR

@monokal
Copy link

monokal commented Sep 5, 2022

I'm currently making a 2nd request, which obviously isn't ideal, but here's how I'm extracting the primary image via xpath. Hope it helps.

def _get_image(self, page_html):
        image_url = page_html.html.xpath(
            '//*[@id="root"]/main/div/article/meta', first=True
        )

        try:
            return image_url.attrs["content"]

        except AttributeError:
            return "https://via.placeholder.com/450x300.png?text=No+Image!"

@williamy2k
Copy link

Thanks @monokal ! I ended up doing it slightly differently, here is the PR I submitted: #43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants