Spaces:
Sleeping
Sleeping
Create ingest/adapters/cia.py
Browse files- ingest/adapters/cia.py +2 -2
ingest/adapters/cia.py
CHANGED
|
@@ -11,6 +11,7 @@ class CIAAdapter(GenericFOIAAdapter):
|
|
| 11 |
return []
|
| 12 |
|
| 13 |
await self._rate_limit()
|
|
|
|
| 14 |
params = {"search_api_fulltext": query}
|
| 15 |
|
| 16 |
async with aiohttp.ClientSession() as session:
|
|
@@ -23,14 +24,13 @@ class CIAAdapter(GenericFOIAAdapter):
|
|
| 23 |
for item in soup.select(".search-result"):
|
| 24 |
title = item.select_one("h3")
|
| 25 |
link = item.select_one("a")
|
| 26 |
-
|
| 27 |
if not title or not link:
|
| 28 |
continue
|
| 29 |
|
| 30 |
results.append({
|
| 31 |
"source": self.source_name,
|
| 32 |
"title": title.text.strip(),
|
| 33 |
-
"url": link
|
| 34 |
"snippet": title.text.strip()
|
| 35 |
})
|
| 36 |
|
|
|
|
| 11 |
return []
|
| 12 |
|
| 13 |
await self._rate_limit()
|
| 14 |
+
|
| 15 |
params = {"search_api_fulltext": query}
|
| 16 |
|
| 17 |
async with aiohttp.ClientSession() as session:
|
|
|
|
| 24 |
for item in soup.select(".search-result"):
|
| 25 |
title = item.select_one("h3")
|
| 26 |
link = item.select_one("a")
|
|
|
|
| 27 |
if not title or not link:
|
| 28 |
continue
|
| 29 |
|
| 30 |
results.append({
|
| 31 |
"source": self.source_name,
|
| 32 |
"title": title.text.strip(),
|
| 33 |
+
"url": link.get("href"),
|
| 34 |
"snippet": title.text.strip()
|
| 35 |
})
|
| 36 |
|