--- title: Built a web script synthesizer date: 2025-04-02 layout: post project: true thumbnail: thumb_sm.png --- One year at the trading firm. Scripts are saturating CPUs, stalling servers; Forced to restart them. 2025-02: Built a tool to record browser sessions and synthesize better scripts. Stack: C# WinForms, WebView2 (Edge), Scintilla.NET editor. Injected JS hooks, WebView2 and the editor generate events. If-else blocks convert them to Selenium code. Optimizer squashes multiple events into single commands (e.g., calendar clicks → text input), uses heuristics to improve DOM addressing (xpath, id, element). Two linear lists store events and code—no ASTs. Mid-session manual edits desync lists, block optimizer. Workaround: only edit scripts at the end of recording. 2025-03: Shipped the first iteration. Began work on key optimization: bypass the browser, grab data files directly. 2025-04: Abandoned project. Left the firm.