Spaces:
Sleeping
Sleeping
Nicolas Lozano commited on
Commit ·
cdd9ca9
1
Parent(s): 6d7c0ef
arreglo retries
Browse files
v4.1.0/src/scrapers/google_scraper.py
CHANGED
|
@@ -133,15 +133,16 @@ class GoogleScraper(BaseScraper):
|
|
| 133 |
|
| 134 |
|
| 135 |
i = 0
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
|
|
|
| 145 |
|
| 146 |
self.articles.extend(articulos_dia[:remaining])
|
| 147 |
d += timedelta(days=1)
|
|
|
|
| 133 |
|
| 134 |
|
| 135 |
i = 0
|
| 136 |
+
if not blocked:
|
| 137 |
+
while i < len(cards) - 1 and len(articulos_dia) < remaining:
|
| 138 |
+
articulo = self.parse(cards[i], d.strftime("%Y-%m-%d"))
|
| 139 |
+
if articulo:
|
| 140 |
+
articulos_dia.append(articulo)
|
| 141 |
+
pbar.update(1)
|
| 142 |
+
i += 1
|
| 143 |
+
|
| 144 |
+
sleep(random.uniform(3, 6))
|
| 145 |
+
page_index += 1
|
| 146 |
|
| 147 |
self.articles.extend(articulos_dia[:remaining])
|
| 148 |
d += timedelta(days=1)
|