我正在寻找问题,但是我只能得到解决方法来摆脱信息栏,这不是正确的解决方案。实际上,chrome阻止了我的代码对其进行控制,因此chrome这次对我的代码采取了行动,而不仅仅是警告。
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
##chrome_options = Options()
##chrome_options.add_argument("--disable-infobars")
##browser = webdriver.Chrome(options=chrome_options)
browser = webdriver.Chrome()
browser.get('https://www.nseindia.com/products/content/equities/equities/eq_security.htm')
search_box = browser.find_element_by_name('symbol')
search_box.send_keys('YESBANK')
browser.find_element_by_css_selector("input#rdDateToDate").click()
search_box = browser.find_element_by_id('fromDate')
search_box.send_keys('01-03-2019')
##search_box.send_keys('1 month')
search_box = browser.find_element_by_id('toDate')
search_box.send_keys('01-05-2019')
search_box.submit()