After trying to launch the JS-generated page with Chrome WebDriver Selenium, I see no content generated in vue-app tag.
<div class="vue-app">
</div>
is simply replaced by
<!---->
The rest of the page renders normally.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
# Chrome Driver Setup
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless') # Run in headless mode
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(service=Service('/usr/local/bin/chromedriver-linux64/chromedriver'), options=chrome_options)
try:
url = 'https://example.com'
driver.get(url)
page_html = driver.page_source
print(page_html)
WebDriverWait(driver, 5).until(
EC.presence_of_element_located((By.CLASS_NAME, "vue-app"))
)
except TimeoutException:
print("The element was not found or the page did not load in the expected time frame.")
finally:
# Close the browser
driver.quit()