Building a Resilient Price Tracker in Broma: Multi‑Step Monitoring Flow
Why a Dedicated Price Tracker Matters
E‑commerce operators, marketers, and QA teams often need to watch prices, stock levels, or competitor offers on a regular basis. Manually checking dozens of URLs each day is tedious, error‑prone, and quickly becomes a bottleneck. A Broma flow lets you automate this repetitive check, keep a historical log, and react when prices cross a threshold—all without writing a single line of code.
The key to a reliable price tracker is resilience. Web pages change selectors, layout, or even the HTML tags that hold price information. A flow that relies on a fragile selector will break, leaving you with missed alerts. In this guide we’ll build a complete price‑monitoring workflow that:
- Uses stable selectors (data‑attrs, consistent CSS classes) that survive minor redesigns.
- Stores previous prices in a simple CSV file so you can detect changes.
- Takes a screenshot only when a price moves, reducing noise.
- Logs the new price, timestamp, and any change amount.
- Runs on a schedule and records each run in Broma’s run log.
- Reuses the same flow across multiple products and team members using separate browser profiles.
1. Set Up a Dedicated Browser Profile
Before you start building the flow, isolate your price‑checking work from everyday browsing. Broma’s profile manager lets you create a new profile that carries its own cookies, extensions, and proxy settings.
- Open Broma → Profiles → Add Profile.
- Name it PriceTracker.
- Enable any required extensions (e.g., a password manager if you need to log in).
- Choose a proxy if you need to rotate IPs (optional).
- Save the profile.
All subsequent flows will use this profile, keeping your login state and any site‑specific cookies intact.
2. Describe the Flow in Plain Language (AI‑Assisted)
Broma’s AI can turn a natural‑language description into a functional workflow. Open the AI Builder and paste something like:
"Open the product page for URL https://example.com/product/123, wait for the price element, read its text, compare with the value stored in /data/previous_prices.csv, and if it changed, write the new price to the CSV and capture a screenshot."
The AI will generate the steps, but you’ll still need to review and fine‑tune selectors and data paths. This approach is great for rapid prototyping, and you’ll end up with a solid foundation to refine.
3. Choose Selectors That Survive Page Changes
When you review the AI‑generated flow, replace any volatile CSS or XPath selectors with more durable ones. Look for:
- data-testid or data-cy attributes.
- aria‑label combined with a parent tag.
- Consistent CSS classes that are unlikely to be renamed (e.g.,
.price,.current-price).
For example, if the price on example.com lives in <span class="price">$49.99</span> and the site occasionally wraps it in a <div>, you can target the parent element and then extract the inner text:
// Select the price container (stable selector)
const priceContainer = document.querySelector('[data-testid="product-price"]');
// Fallback to CSS class if data attribute missing
if (!priceContainer) {
priceContainer = document.querySelector('.price');
}
// Extract text and clean formatting
const raw = priceContainer.textContent.trim();
const price = raw.replace(/[^0-9.,]/g, ''); // keep numbers and commas
return price;
Add this snippet as a Custom JavaScript step in Broma to ensure you always get a clean numeric value.
4. Store and Compare Previous Prices
Create a simple CSV file (e.g., price_tracker.csv) in a folder you can access from the workflow. The file should have three columns:
url– the product page URLprevious_price– last known price (numeric)last_updated– timestamp of the last check
Initial setup – If the CSV does not exist, Broma can create it with a “Create if missing” step. Populate it with the first known price manually, or let the flow write a placeholder.
Comparison logic – In Broma you can add a Conditional step that runs JavaScript to compare the extracted price with the stored value:
const url = "https://example.com/product/123";
const stored = getCSVValue(url, 'previous_price'); // custom function you add via a “Read CSV” step
const current = price; // from the extraction step
if (parseFloat(current) !== parseFloat(stored)) {
// price changed – trigger actions
setVar('price_changed', true);
setVar('old_price', stored);
setVar('new_price', current);
} else {
setVar('price_changed', false);
}
Broma’s Branch step lets you route to “If changed” and “If unchanged” sections of the flow.
5. Log the New Price and Capture a Screenshot
5.1 Update the CSV
When a change is detected, write the new price back to the CSV and also append a timestamp. Broma’s Write CSV step can be configured to append or overwrite based on the URL.
File: price_tracker.csv
Columns: url, previous_price, last_updated
Action: Append
Values: https://example.com/product/123, $49.99, 2025-12-17T14:23:00Z
5.2 Screenshot (Optional but Useful)
Add a Take Screenshot step that runs only in the “changed” branch. Name the file with a timestamp and the product identifier, e.g., price_change_2025-12-17_14-23-01.png. This visual proof is handy for audit trails.
6. Schedule the Flow and Review Run Logs
- In Broma’s Scheduler, add a new job.
- Set the Trigger to “Every day at 09:00” (or any interval you need).
- Point the job to the Price Tracker flow you just built.
- Enable Run logs – Broma will store each execution status, errors, and output.
When you open the Run History, you’ll see:
- Success/failure status.
- Timestamp of each run.
- Any error messages (e.g., selector missing).
- Links to screenshots captured during that run.
Reviewing the log weekly helps you spot broken selectors before they cause missed price alerts.
7. Reusing the Flow Across Products and Team Members
Because the flow is built around a generic URL and price selector variable, you can parameterize it:
- Add a Input step at the start that asks for
product_urlandprice_selector. - Use Broma’s Set Variable to inject these values before the extraction step.
Different team members can each have their own PriceTracker profile (see Step 1). By sharing the same flow file, they avoid duplication while keeping login cookies isolated.
If you need to monitor dozens of products, create a master CSV of URLs and loop over them using Broma’s For Each step. For each URL, run the same price‑check logic and write results to a combined report CSV.
8. Troubleshooting Common Issues
| Symptom | Likely Cause | Quick Fix |
|---|---|---|
| No price extracted | Selector outdated after site redesign | Switch to a more stable data-testid or add a fallback CSS selector in the custom JS step. |
| Flow fails with “Element not found” | Page loads slowly or requires waiting for lazy‑loaded content | Insert a Wait for Element step with a longer timeout, or add a Wait for Network Idle before extraction. |
| CSV writes duplicate rows | Append mode without checking existing entry | Use a Read CSV step to check if URL exists first, then decide to Update vs Append. |
| Scheduled run never starts | Scheduler service not running or incorrect time zone | Verify Broma’s scheduler daemon is active and set the correct timezone in Settings. |
9. Extending the Flow (Optional Enhancements)
- Email Alerts – Add a Send Email step (configure SMTP in Broma) that triggers only when a price drops above a threshold.
- Slack/Teams Notification – Use a webhook step to post a message with the old/new price.
- Price Trend Analysis – Append a rolling average column in the CSV and generate a simple line chart using an external tool (e.g., Python pandas) on the exported data.
These extensions keep the core flow simple and maintainable while giving you powerful reporting capabilities.
10. Recap – Key Takeaways
- Isolation matters – a dedicated browser profile protects login state and avoids cookie conflicts.
- Stable selectors – prioritize
data-testidor consistent class names; always include a fallback in custom JavaScript. - Comparison logic – store previous prices in a CSV, compare each run, and branch actions based on change detection.
- Logging and screenshots – capture visual evidence only when needed to reduce clutter and aid audits.
- Scheduling and review – rely on Broma’s built‑in scheduler and run logs to keep the workflow healthy over time.
- Reusability – parameterize URLs and selectors, and loop over multiple products to scale without rebuilding.
By following the steps above you’ll have a production‑ready price tracker that runs automatically, adapts to minor page changes, and gives you actionable insights without any coding effort. Happy automating!
