It\'s only happen when I use the headless mode.
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument(\'--headless\')
driver
You were almost there. You simply need to induce WebDriverWait for the desired element to be visible and you can use the following solution:
Code Block:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument("start-maximized")
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
driver.get('https://www.windguru.cz/3640')
WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "#forecasts-page")))
print(driver.page_source)
driver.quit()
Console Output:
Windguru - Argentina - Mar del Plata