簡體   English   中英

為什么我會收到一個功能錯誤,說我需要在我的 python 代碼中添加一個功能?

[英]why do I get a capability error saying that I need to add a capability in my python code?

請檢查此鏈接中的錯誤。 我收到此錯誤。 由於我是新來的,我無法添加圖片。 運行代碼時出現此錯誤。 [1]: https : //i.stack.imgur.com/6XFH3.png

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import time

def account_info():
    with open('account_info.txt','r') as f:
        info = f.read().split()
        email = info[0]
        password = info[1]
    return email, password

email, password = account_info()

tweet = 'Hello world, this is Jarvis'

option = Options()
option.add_argument('start-maximised')
driver = webdriver.Chrome(options=Options)

driver.get('https://twitter.com/login')


  

您的代碼有一個小錯誤。 您正在將Options對象傳遞給 webdriver 的options參數。 相反,傳入您剛剛創建的Options實例。

# code continues above

tweet = 'Hello world, this is Jarvis'

chrome_options = Options()
chrome_options.add_argument('start-maximised')
driver = webdriver.Chrome(options=chrome_options)

driver.get('https://twitter.com/login')

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM