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
34 lines
1.3 KiB
Python
34 lines
1.3 KiB
Python
import asyncio
|
|
from browser_use import BrowserSession
|
|
from browser_config import make_profile
|
|
BASE = "http://localhost:3001/scout"
|
|
|
|
|
|
async def ev(s, e):
|
|
cdp = await s.get_or_create_cdp_session()
|
|
r = await cdp.cdp_client.send.Runtime.evaluate(params={"expression": e, "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]')].find(e=>(e.textContent||'').trim().toLowerCase().includes('{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=1100)
|
|
except Exception:
|
|
pass
|
|
await ev(s, "try{localStorage.removeItem('scout-onboarded')}catch(e){}")
|
|
await s.navigate_to(BASE); await asyncio.sleep(4)
|
|
await click(s, "Configure"); await asyncio.sleep(1.5)
|
|
await s.take_screenshot(path="/tmp/cfg_collapsed.png", full_page=True); print("collapsed")
|
|
await click(s, "See all"); await asyncio.sleep(.8)
|
|
await click(s, "Adjust"); await asyncio.sleep(1.0)
|
|
await s.take_screenshot(path="/tmp/cfg_expanded.png", full_page=True); print("expanded")
|
|
await s.kill()
|
|
|
|
asyncio.run(main())
|