{"record":{"id":"79d548e5f31e2002","repo":"SeleniumHQ/selenium","slug":"module-name-r-has-no-attribute-name-r-79d548","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/edge/__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 = [\"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/edge/__init__.py#L10-L33","documentation":"Raised by the module-level __getattr__ in selenium.webdriver.edge when an attribute access does not match one of the lazily-imported submodules (options, remote_connection, service, webdriver). The package uses PEP 562 lazy imports to reduce startup cost, so only those four names auto-resolve; anything else raises a clear AttributeError naming the missing attribute.","triggerScenarios":"Accessing selenium.webdriver.edge.SomeName where SomeName is not in _LAZY_SUBMODULES — e.g. a typo like 'option' instead of 'options', or trying to access a class that lives in a submodule without the submodule prefix (e.g. selenium.webdriver.edge.Options instead of selenium.webdriver.edge.options.Options).","commonSituations":"Typing the submodule name wrong, expecting a top-level re-export that does not exist, or IDE auto-complete suggesting a non-existent attribute. Also from 'from selenium.webdriver.edge import X' where X is not a known submodule.","solutions":["Check the spelling against _LAZY_SUBMODULES: options, remote_connection, service, webdriver.","Access classes through their submodule: from selenium.webdriver.edge.options import Options."],"exampleFix":"# before\nfrom selenium.webdriver.edge import Options  # -> AttributeError\n\n# after\nfrom selenium.webdriver.edge.options import Options","handlingStrategy":"validation","validationCode":"from selenium.webdriver import edge\n_VALID = {'options','remote_connection','service','webdriver','firefox_profile'}\nassert name in _VALID, f'{name!r} is not an edge submodule; use edge.<submodule>.<Class>'","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Import classes from their submodule: edge.options.Options.","Rely on IDE go-to-definition rather than guessing top-level names.","Keep a cheat-sheet of the five lazy submodules."],"tags":["edge","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"}