Не сохраняет html selenium
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
import time
def get_source_html(url):
service = Service(executable_path='./chromedriver.exe')
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)
driver.maximize_window()
try:
driver.get(url=url)
time.sleep(3) # Увеличьте задержку перед поиском элемента
actions = ActionChains(driver)
find_more_element = driver.find_element(By.CSS_SELECTOR, '.e798o580.app-catalog-127qi1g.e1x8kbo0')
actions.move_to_element(find_more_element).perform()
with open('page.html', 'w') as f:
f.write(driver.page_source)
except Exception as _ex:
print(_ex)
finally:
driver.close()
driver.quit()
def main():
get_source_html('https://www.citilink.ru/catalog/processory/?p=1')
if __name__ == '__main__':
main()
подскажите, что не так?