I am trying to get all the hotels but even though I have executed scrolled down script my page_source shows just the html code that contains 11 hotels i.e. what was loaded initially.
How can I get the entire data source code after scrolling down to scrape all the hotels?
If driver.execute script is loading the entire page then how do I store the page source of entire page in my variable?
PS: this is just for educational purpose
from selenium import webdriver
import re
import pandas as pd
import time
chrome_path = r"C:\Users\ajite\Desktop\web scraping\chromedriver.exe"
driver = webdriver.Chrome(chrome_path)
driver.get('https://www.makemytrip.com/mmthtl/site/hotels/search?checkin=02252018&checkout=02262018&roomStayQualifier=1e0e&city=GOI&searchText=Goa,%20India&country=IN')
driver.implicitly_wait(3)
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(5)
two_hotels = driver.find_elements_by_xpath('//*[@id="hotel_card_list"]/div')