INNER CODE UNIT · Python

CFormsParser

witchan/ios-mcp · scripts/submit_bigboss_update.py:28

class CFormsParser(html.parser.HTMLParser):
    def __init__(self, form_id: str) -> None:
        super().__init__()
        self.form_id = form_id
        self.in_form = False
        self.form_seen = False
        self.action = ""
        self.method = "post"
        self.hidden_fields: dict[str, str] = {}

    def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
        attr = {key: (value or "") for key, value in attrs}
        if tag.lower() == "form" and attr.get("id") == self.form_id:
            self.in_form = True
            self.form_seen = True
            self.action = attr.get("action", "")
            self.method = attr.get("method", "post").lower()
            return

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…