1

I am trying to scrape the commodities futures table (https://www.investing.com/commodities/real-time-futures)

scraping itself goes well (i.e. getting the table html code and so on), but I want to get the screenshot of this table. And everytime i try i am getting unwanted artifacts like popup windows, breaking news pop up, duplicate navbars, ads.

Is there a way to remove them from viewspace of the table?

from selenium import webdriver
from selenium.webdriver import ChromeOptions, FirefoxOptions
from Screenshot import Screenshot_Clipping

ss = Screenshot_Clipping.Screenshot()

url='https://www.investing.com/commodities/real-time-futures'

options = FirefoxOptions()
options.headless = True
with webdriver.Firefox(options=options) as browser:
    browser.maximize_window()

    browser.get(url)

    element = browser.find_element_by_id("cross_rate_1")
    
    img_url=ss.get_element(browser, element, r'.')
leo_113
  • 11
  • 1

0 Answers0