I am trying to close add using close button but not able to locate it in second line. I tried to click on time frame button. See this link and tell me where I was wrong:
https://uk.investing.com/commodities/us-sugar-no11-historical-data
ad_close=driver.find_element(By.XPATH,"/html/body/div[2]/div/div/form/div/button")
ad_close.click()
print("ADclosed")
time_frame = driver.find_element(By.XPATH,"/html/body/div[1]/div[2]/div[2]/div[2]/div[1]/div[3]/div[2]/div[1]/div[2]/span")
time_frame.click()
print("click")
I have tried all possible solutions.
New contributor
NIKHIL RANA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1