AttributeError: 'Options' object has no attribute 'installed'
时间: 2023-10-06 07:09:37 浏览: 160
AttributeError: ‘NoneType’ object has no attribute ‘children’ 错误
5星 · 资源好评率100%
这个错误是由于在代码中引用了一个不存在的属性"installed"导致。根据引用中提供的正确代码,可以看出正确的属性应该是"binary"而不是"installed"。因此,可以更正代码为:
from selenium.webdriver.firefox.options import Options
options = Options()
options.add_argument("--proxy-server=127.0.0.1:8118")
s = Service(r'C:/Program Files/Mozilla Firefox/geckodriver.exe')
driver = webdriver.Firefox(service=s, options=options)
url = 'https://item.taobao.com'
driver.get(url)
这样就可以避免出现"AttributeError: 'Options' object has no attribute 'installed'"的错误了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [已解决AttributeError: ‘DataFrame‘ object has no attribute ‘ix](https://blog.csdn.net/yuan2019035055/article/details/124558014)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [AttributeError:‘Options‘ object has no attribute ‘binary](https://blog.csdn.net/weixin_44523648/article/details/124029122)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文