I'm trying to scrape a dynamic website with selenium but not be able to get the website content with selenium.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
from bs4 import BeautifulSoup
import time
url = 'https://www.aodour.pk/brand/hemani'
driver.get(url)
time.sleep(30) #for loading the page properly
html_js = driver.page_source
#driver.find_element_by_tag_name('body').send_keys(Keys.ESCAPE)
#I tried to skip the AD but didn't know why not it skip the AD
driver.get(url) #try to reload the page again (for skipped the Ad)
time.sleep(30)
soup = BeautifulSoup(html_js,'html.parser')
I have two questions.
Why not I'm getting the page content?
Why not ESCAPE keys is working for me?