Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-3-7-sonnet-20250219· AnthropicHugging Face LMArena Human Preference 140K

Write a python function that accepts single page's html code as an input, tries to find…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Qwenqwen-max-2025-01-25’s answer.
  1. User

    Write a python function that accepts single page's html code as an input, tries to find it there is a steam store app id mentioned somewhere in the text, and returns this app id, it it's true, or returns 0 if there isn't

  2. Claude Assistant

    Here's a Python function to extract a Steam app ID from HTML content:

    import re
    
    def extract_steam_app_id(html_content):
        # Common patterns for Steam app IDs in HTML
        patterns = [
            r'store\.steampowered\.com/app/(\d+)',  # URLs
            r'steam_app_id["\s:=]+(\d+)',           # Meta tags or JS variables
            r'app[/_-](\d+)',                       # Various formats
            r'steamapp[/_-](\d+)',                  # Various formats
            r'AppId["\s:=]+(\d+)',                  # JS or meta variables
            r'data-steam-id="(\d+)"'                # Data attributes
        ]
        
        for pattern in patterns:
            matches = re.findall(pattern, html_content, re.IGNORECASE)
            if matches:
                return int(matches[0])
        
        return 0
    

    Would you like me to explain or break down this code?

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.