From 39c192da7ab7b0a20ed8445b6bd73c8facb2a5b0 Mon Sep 17 00:00:00 2001 From: Sam Briggs Date: Thu, 27 Oct 2022 21:00:07 +0100 Subject: [PATCH] [#46] Fix floorplan URL selector Fix issue reported that finds floorplans now require a different selector --- rightmove_webscraper/scraper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rightmove_webscraper/scraper.py b/rightmove_webscraper/scraper.py index 12acc0b..b6f2e5e 100644 --- a/rightmove_webscraper/scraper.py +++ b/rightmove_webscraper/scraper.py @@ -189,7 +189,7 @@ def _get_page(self, request_content: str, get_floorplans: bool = False): if status_code != 200: continue tree = html.fromstring(content) - xp_floorplan_url = """//*[@id="floorplanTabs"]/div[2]/div[2]/img/@src""" + xp_floorplan_url = """//*[contains(@alt, 'Floorplan')]/@src""" floorplan_url = tree.xpath(xp_floorplan_url) if floorplan_url: floorplan_urls.append(floorplan_url[0])