I am trying to fetch data using selenium webdriver and beautiful soup from a website. Below segment of code is taking a long time to execute.
time1 = time.time()
options = webdriver.ChromeOptions()
options.add_argument('headless')
driver = webdriver.Chrome(chrome_options=options)
driver.get("https://www.bseindia.com/")
elem = driver.find_element_by_id("suggestBoxEQ")
elem.clear()
elem.send_keys("538707")
elem.send_keys(Keys.RETURN)
print(driver.current_url)
html = driver.page_source
soup = BeautifulSoup(html, 'lxml')
driver.quit()
time2 = time.time()
print(time2-time1)
It takes 13.876
seconds to execute this code. Is there any way to speed up execution time of current code or another faster method to get fetch the data?