0

I have been trying to access data in an iFrame using Selenium and BeautifulSoup4 without any success.
I want to retrieve the data present in this dashboard.

Do you have any suggestions?

PersianMan
  • 924
  • 1
  • 12
  • 29
  • Welcome to SO - Please take the [tour] and read [ask] to improve, [edit] and format your questions. Thanks – HedgeHog Oct 29 '21 at 11:38
  • Does this answer your question? https://stackoverflow.com/questions/49825722/scraping-iframe-using-selenium – Ali Sajjad Oct 29 '21 at 12:30
  • Does this answer your question? [Scraping iframe using Selenium](https://stackoverflow.com/questions/49825722/scraping-iframe-using-selenium) – Ali Sajjad Oct 29 '21 at 12:31
  • Please provide enough code so others can better understand or reproduce the problem. – Community Oct 29 '21 at 14:00

1 Answers1

-1

there is a many method

for example get iframe link with selenium (if it's dynamic) and load it directly

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


src = driver.find_elements_by_xpath("//iframe").get_attribute("src")
print(src)
driver.get(src)
element = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.CLASS_NAME, "master-number"))
    )
# now you can find element in iframe
#driver.find_elements_by_....

more info about wait

PersianMan
  • 924
  • 1
  • 12
  • 29