0

I am trying to extract the information from this website: http://reportes.sui.gov.co/fabricaReportes/frameSet.jsp?idreporte=acu_com_150

I am using selenium for that purpose but I have been unable to locate each element of year, department or municipality.

from selenium import webdriver
from selenium.webdriver.support.ui import Select
import time

driver = webdriver.Chrome() 
driver.get('http://reportes.sui.gov.co/fabricaReportes/frameSet.jsp?idreporte=acu_com_150')
time.sleep(5)

selectYear = Select(driver.find_element_by_name("acu_com_150.agno"))

I get the following error:

NoSuchElementException: no such element: Unable to locate element:
3
  • 1
    The Website you have provided seems down. Commented Sep 11, 2020 at 17:10
  • 1
    I can't open this page in web browser. Commented Sep 11, 2020 at 18:16
  • Maybe the website is only accessible from certain countries. Commented Sep 11, 2020 at 21:01

1 Answer 1

1

The dropdown box you are after its inside an iframe and need to switch to iframe first in order to access the element.

Induce WebDriverWait() and wait for frame_to_be_available_and_switch_to_it()

Induce WebDriverWait() and wait for visibility_of_element_located()

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
from selenium.webdriver.support.select import Select

driver = webdriver.Chrome()
driver.get("http://reportes.sui.gov.co/fabricaReportes/frameSet.jsp?idreporte=acu_com_150")
WebDriverWait(driver,10).until(EC.frame_to_be_available_and_switch_to_it((By.ID,"header")))
select=Select(WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.NAME,"acu_com_150.agno"))))
select.select_by_value("2018")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.