Task: Convert Raw JavaScript Objects to Python Dictionaries
Task: Convert Raw JavaScript Objects to Python Dictionaries: a task in Terminal-Lego-15k (Harbor dataset). When web scraping, you often encounter JavaScript object literals that are not in valid JSON format. Unlike JSON, JavaScript object notation allows unquoted keys (e.g., {x:1, y:2} instead of…
The task
When web scraping, you often encounter JavaScript object literals that are not in valid JSON format. Unlike JSON, JavaScript object notation allows unquoted keys (e.g., `{x:1, y:2}` instead of `{"x":1, "y":2}`), which means `json.loads()` cannot parse them directly.
Part of PrimeIntellect/Terminal-Lego-15k.