{"record":{"id":"bcdb12e920f08d66","repo":"SeleniumHQ/selenium","slug":"module-name-r-has-no-attribute-name-r-bcdb12","errorCode":null,"errorMessage":"module {__name__!r} has no attribute {name!r}","messagePattern":"module (.+?) has no attribute (.+?)","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"warning","filePath":"py/selenium/webdriver/firefox/__init__.py","lineNumber":28,"sourceCode":"#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n\nimport importlib\n\n_LAZY_SUBMODULES = [\"firefox_profile\", \"options\", \"remote_connection\", \"service\", \"webdriver\"]\n\n\ndef __getattr__(name):\n    if name in _LAZY_SUBMODULES:\n        module = importlib.import_module(f\".{name}\", __name__)\n        globals()[name] = module\n        return module\n    raise AttributeError(f\"module {__name__!r} has no attribute {name!r}\")\n\n\ndef __dir__():\n    return sorted(_LAZY_SUBMODULES)\n","sourceCodeStart":10,"sourceCodeEnd":33,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/py/selenium/webdriver/firefox/__init__.py#L10-L33","documentation":"Raised by the module-level __getattr__ in selenium.webdriver.firefox when an attribute access does not match one of the lazily-imported submodules (firefox_profile, options, remote_connection, service, webdriver). Identical lazy-import pattern to the edge package; only those five names auto-resolve, anything else raises AttributeError.","triggerScenarios":"Accessing selenium.webdriver.firefox.SomeName not in _LAZY_SUBMODULES — e.g. a typo like 'profile' instead of 'firefox_profile', or expecting a top-level class re-export like selenium.webdriver.firefox.Options (must be selenium.webdriver.firefox.options.Options).","commonSituations":"Typing the submodule name, IDE auto-complete picking a wrong suggestion, or 'from selenium.webdriver.firefox import X' where X is not a known submodule. Common confusion is using 'profile' instead of 'firefox_profile'.","solutions":["Check the spelling against _LAZY_SUBMODULES: firefox_profile, options, remote_connection, service, webdriver.","Access classes through their submodule: from selenium.webdriver.firefox.options import Options."],"exampleFix":"# before\nfrom selenium.webdriver.firefox import profile  # -> AttributeError\n\n# after\nfrom selenium.webdriver.firefox import firefox_profile","handlingStrategy":"validation","validationCode":"from selenium.webdriver import firefox\n_VALID = {'firefox_profile','options','remote_connection','service','webdriver'}\nassert name in _VALID, f'{name!r} is not a firefox submodule'","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Import classes from their submodule: firefox.options.Options.","Remember the profile submodule is named firefox_profile, not profile.","Use IDE navigation rather than guessing top-level re-exports."],"tags":["firefox","lazy-import","import-error","attributeerror"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}