Skip to content

Commit fbf85ed

Browse files
committed
test added
1 parent 738d715 commit fbf85ed

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

tests/test_iisc.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"""
2+
Real-time debug script for the IISc Bangalore tender scraper.
3+
4+
Purpose:
5+
Fetches live data from the IISc tender portal and performs a keyword search
6+
for specific target phrases (e.g., 'lithography') to verify scraper accuracy.
7+
"""
8+
from scrapers.iisc import scrape_iisc
9+
10+
11+
def main():
12+
print("=" * 80)
13+
print("LIVE IISc SCRAPE DEBUG")
14+
print("=" * 80)
15+
16+
tenders = scrape_iisc()
17+
18+
print(f"\nTotal tenders scraped: {len(tenders)}\n")
19+
20+
if not tenders:
21+
print("No tenders returned from scraper.")
22+
return
23+
24+
found_target = False
25+
target_phrase = "maskless laser lithography"
26+
27+
for idx, tender in enumerate(tenders, 1):
28+
title = tender.get("title", "")
29+
org = tender.get("organization", "")
30+
date = tender.get("published_date", tender.get("date", "N/A"))
31+
url = tender.get("source_url", "N/A")
32+
33+
print(f"[{idx}]")
34+
print(f"Title: {title}")
35+
print(f"Organization: {org}")
36+
print(f"Date: {date}")
37+
print(f"URL: {url}")
38+
print("-" * 80)
39+
40+
if target_phrase in title.lower():
41+
found_target = True
42+
43+
print("\n" + "=" * 80)
44+
print("TARGET CHECK")
45+
print("=" * 80)
46+
47+
if found_target:
48+
print("FOUND: Maskless laser lithography tender is being scraped.")
49+
else:
50+
print("NOT FOUND: scraper is missing the tender.")
51+
print("This means the issue is in scrapers/iisc.py, not matching/email.")
52+
53+
54+
if __name__ == "__main__":
55+
main()

0 commit comments

Comments
 (0)