Skip to content

Commit c19b673

Browse files
DAFT-11: Misc fixes (TheJokersThief#11)
1 parent fa982ae commit c19b673

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

daft_scraper/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def __init__(self, user_agent=None, enable_retries=True):
3636
if enable_retries:
3737
retry_strategy = Retry(
3838
total=3,
39+
status_forcelist=[500, 502, 503, 504],
3940
backoff_factor=0.1
4041
)
4142
adapter = requests.adapters.HTTPAdapter(max_retries=retry_strategy)

daft_scraper/listing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class Meta:
7575

7676

7777
class ListingSchema(Schema):
78-
URL_BASE = "https://daft.ie"
78+
URL_BASE = Daft.BASE_URL
7979
PRICE_RE = re.compile(r'[0-9,]+')
8080

8181
class Meta:
@@ -149,7 +149,7 @@ def ad_page_info(self):
149149

150150
@property
151151
def description(self) -> str:
152-
return self.ad_page_info['props']['pageProps']['listing'].get('description', None)
152+
return self.ad_page_info['props']['pageProps'].get('listing', {}).get('description', None)
153153

154154
@property
155155
def county(self) -> list:

0 commit comments

Comments
 (0)