Python Forum

Full Version: Need help on extract dynamic table data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, all

I am trying to extract table data (property lease and sold) from below link:

https://oir.centanet.com/en/transaction/...ntindex=-1

I tried many method to extract, but still fail. Below is my code for your reference. I hope to extract the property sell data and insert into pandas dataframe for easy manage

base_url = str("https://oir.centanet.com/en/transaction/index?daterang=01%2F05%2F2019-29%2F04%2F2021&pageindex=0&pagesize=10&suggestlist=%5B%5D&posttype=0&districts=&sortby=0&usages=&pricetype=0&minprice=&maxprice=&renttype=0&minrent=&maxrent=&minarea=&maxarea=&centabldg=&sellindex=-1&rentindex=-1")

driver.get(base_url)

sleep(30)

tables=WebDriverWait(driver,20).until(EC.presence_of_all_elements_located((By.XPATH,"//*[@id='__layout']/div/div[1]/div/div[3]/div[1]/div[2]/table/tbody")))

for t in range(len(tables)):
    print("element in list: ",tables[t].text)
Thank You for your help