Try to do the following:
- Input a stock code under "Stock Code/Stock Name", wait till all things pop up and choose the first item
- Under Headline Category and Document Type, select "Headline Category" -> "Announcement and Notices" -> "New Listing(Listed Issuers/New Applicants") -> "Allotment Result"
- Click "Search Button" to open new page
- Click on link under "Announcements and Notices - [Allotment Results]"
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Firefox(executable_path = "C:\Program Files\Mozilla Firefox\geckodriver.exe")
driver.implicitly_wait(5)
driver.get("https://www1.hkexnews.hk/search/titlesearch.xhtml")
wait = WebDriverWait(driver, 5)
wait.until(EC.element_to_be_clickable((By.ID, "searchStockCode"))).send_keys("01156)
????