I want to find element on page that only loads when user scroll to it. In order to scroll to it I have to find it. However in order to find it I have to scroll to it so it displays in html. Is there any workaround.
I tried finding elements by xpath to assure myself that there are no such elements findable.
channel_text = driver.find_element_by_xpath(f"//*[contains(text(), '{name_of_text_inside_tag}')]")
When I open the page in developer mode and search by xpath it findes none. However when I scroll to the element it findes it by the very same xpath.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome()
# get discord server
driver.get("https://discordapp.com/channels/393766374272663564")
# find channel on SCROLLABLE side menu
channel_text = driver.find_element_by_xpath(f"//*[contains(text(), 'channel-name')]")
print(channel_text) # prints empty list
Would appreciate any help.

