summaryrefslogtreecommitdiffstats
path: root/_log/bumblebee.md
blob: a5e761d0d85739d6464ef0a01b1a26cbecb8a902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
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.

<video style="max-width:100%; margin-bottom: 10px" controls="" poster="poster.png">
  <source src="bee.mp4" type="video/mp4">
</video>

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.