Files
matchmaking-v2/research/poc/browser-apply/tour_scout.py
T
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

38 lines
1.3 KiB
Python

"""Capture the lean Scout POC screens."""
import asyncio
from browser_use import BrowserSession
from browser_config import make_profile
URL = "http://localhost:8099/"
CLICK = """(()=>{const t=%r.toLowerCase();const el=[...document.querySelectorAll('button')]
.find(e=>(e.textContent||'').trim().toLowerCase().includes(t));if(el){el.click();return el.textContent.trim()}return null})()"""
async def click(s, t):
cdp = await s.get_or_create_cdp_session()
r = await cdp.cdp_client.send.Runtime.evaluate(
params={"expression": CLICK % t, "returnByValue": True}, session_id=cdp.session_id)
return r.get("result", {}).get("value")
async def shot(s, p):
await s.take_screenshot(path=p, full_page=True); print("shot", p)
async def main():
s = BrowserSession(browser_profile=make_profile(headless=True, persist=False))
await s.start()
try:
await s._cdp_set_viewport(width=720, height=1024)
except Exception:
pass
await s.navigate_to(URL); await asyncio.sleep(3.5)
await shot(s, "/tmp/scout_1_config.png")
print("find ->", await click(s, "Find my matches")); await asyncio.sleep(6.5)
await shot(s, "/tmp/scout_2_deck.png")
print("apply ->", await click(s, "Apply")); await asyncio.sleep(1.5)
await shot(s, "/tmp/scout_3_applied.png")
await s.kill()
asyncio.run(main())