TemplateGenerator ignores page analysis and always returns hardcoded Google Finance selectors
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 101
- Forks
- 27
- Avg merge
- 6m
- Merged PRs (30d)
- 1
Description
Hey, I was trying to use auto-browser easy on a normal non-finance website, but I kept getting finance-related extraction behavior.
After checking the code, I noticed this in:
auto-browser/browser_automation/template_generator.py
def _create_selectors(self, analysis: str) -> Dict[str, Selector]:
"""Create selectors from analysis result."""
selectors = {}
# Common selectors for finance data
selectors.update({
'stock_price': Selector(css='.YMlKec.fxKbKc', ...),
'price_change': Selector(css='.P2Luy.Ez2Ioe', ...),
'company_name': Selector(css='.zzDege', ...),
'market_cap': Selector(css='[data-metric="MARKET_CAP"] .P6K39c', ...),
'volume': Selector(css='[data-metric="VOLUME"] .P6K39c', ...),
'news_items': Selector(css='.yY3Lee', ...),
'search_input': Selector(css='.Ax4B8.ZAGvjd', ...),
})
return selectors
It looks like _create_selectors() receives analysis but does not actually use it. So even when the page is not Google Finance or stock-related, the generated template still gets finance selectors like stock_price, market_cap, volume, etc.
It seems to fall back to these hardcoded finance selectors.
Expected behavior:
If the page is not finance-related, it should not generate finance selectors.
Either the method should parse the analysis result properly, or at least use generic selectors as a fallback.
I can open a small PR for this
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in auto-browser/browser_automation/template_generator.py at TemplateGenerator._create_selectors(), then trace how the analysis argument is produced and passed by auto-browser easy. Verify the behavior with a normal non-finance website. Done means the generated template no longer receives Google Finance selectors for non-finance pages and uses behavior supported by the analysis or a generic fallback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100