Files
matchmaking-v2/research/poc/browser-apply/summary_shots.py
raulgupta 89ca9ad647 Initial commit: matchmaking-v2 on-demand multi-board job-search agent
On-demand Scout service (replaces the nightly aggregator):
- FastAPI agent-mesh service; card name "matchmaking-service" (HTTP /a2a/tasks
  + Redis-stream worker matching the sibling-service pattern)
- run_search: parallel multi-board sweep (Naukri/blackfalcondata + Foundit +
  LinkedIn), city-filtered at the board, cheapest-per-result first
- per-board adapters + normalizers -> ScoutJob with rich read-only details and
  offsite apply links; recall mode + MVQ guard
- result cache for dev replay ($0); per-board cost knobs; retry-on-5xx
- research/: engine design, board cost economics, India-actor shortlist, POC
2026-06-18 19:22:03 +05:30

41 lines
1.6 KiB
Python

"""Capture both states of the Scout Summary tab."""
import asyncio
from browser_use import BrowserSession
from browser_config import make_profile
BASE = "http://localhost:3001/scout"
async def ev(s, expr):
cdp = await s.get_or_create_cdp_session()
r = await cdp.cdp_client.send.Runtime.evaluate(
params={"expression": expr, "returnByValue": True}, session_id=cdp.session_id)
return r.get("result", {}).get("value")
async def click(s, t):
return await ev(s, f"""(()=>{{const el=[...document.querySelectorAll('button,[role=tab],a')]
.find(e=>(e.textContent||'').trim().toLowerCase()==='{t.lower()}');if(el){{el.click();return true}}return false}})()""")
async def main():
s = BrowserSession(browser_profile=make_profile(headless=True, persist=False))
await s.start()
try:
await s._cdp_set_viewport(width=1340, height=1040)
except Exception:
pass
# First-time view (not onboarded)
await ev(s, "try{localStorage.removeItem('scout-onboarded')}catch(e){}")
await s.navigate_to(BASE); await asyncio.sleep(4)
print("summary tab ->", await click(s, "Summary")); await asyncio.sleep(2.5)
await s.take_screenshot(path="/tmp/summ_first.png", full_page=True); print("shot first")
# Returning view (onboarded → summary defaults + metrics)
await ev(s, "try{localStorage.setItem('scout-onboarded','1')}catch(e){}")
await s.navigate_to(BASE); await asyncio.sleep(4.5)
await click(s, "Summary"); await asyncio.sleep(2.5)
await s.take_screenshot(path="/tmp/summ_returning.png", full_page=True); print("shot returning")
await s.kill()
asyncio.run(main())