Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
scraping with multiple iframe
#2
Selenium can be used for this.
Example:
browser = webdriver.Chrome()
# Give some time to load
time.sleep(3)
# Switch to iframe
browser.switch_to.frame(driver.find_element_by_tag_name("iframe"))
# Do some stuff with iframe
elem = driver.find_element_by_xpath("body/p/strong")
elem.send_keys("Lorem Ipsum")
# Back to default content,also out of iframe
driver.switch_to.default_content()
There are also Waits.
wait = WebDriverWait(driver, 300)
wait.until(EC.frame_to_be_available_and_switch_to_it((By.NAME,'iframe_name')))
More info here.
Reply


Messages In This Thread
scraping with multiple iframe - by jansky - Nov-09-2018, 03:21 AM
RE: scraping with multiple iframe - by snippsat - Nov-09-2018, 11:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Information Web-scraping, multiple webpages Pabloty92 1 1,290 Dec-28-2022, 02:09 PM
Last Post: Yoriz
  scraping multiple pages from table bandar 1 2,722 Jun-27-2020, 10:43 PM
Last Post: Larz60+
  Scraping Multiple Pages mbadatanut 1 4,246 May-08-2020, 02:30 AM
Last Post: Larz60+
  selenium click in iframe fails 3Pinter 6 5,174 Apr-29-2020, 12:59 PM
Last Post: Larz60+
  Scraping from multiple URLS to print in a single line. jb89 4 3,386 Jan-29-2020, 06:12 AM
Last Post: perfringo
  How to find which frame/iframe my element belongs to? smaria 1 2,081 Nov-18-2019, 09:21 PM
Last Post: Larz60+
  MaxRetryError while scraping a website multiple times kawasso 6 17,503 Aug-29-2019, 05:25 PM
Last Post: kawasso
  Looping actions in an iframe using Selenium on Python amyd 3 3,056 Mar-06-2019, 08:31 PM
Last Post: Larz60+
  scraping multiple pages of a website. Blue Dog 14 22,487 Jun-21-2018, 09:03 PM
Last Post: Blue Dog
  Unable to select iframe using selenium endejoli 1 3,015 Jan-11-2018, 05:13 PM
Last Post: j.crater

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020