Web scraping an “onclick” object table on a website with python

后端 未结 2 1196
逝去的感伤
逝去的感伤 2021-01-28 17:29

I am trying to scrape the data for this link: page.

If you click the up arrow you will notice the highlighted days in the month sections. Clicking on a highlighted day,

2条回答
  •  忘掉有多难
    2021-01-28 18:18

    Please try below solution

    driver.maximize_window()
    wait = WebDriverWait(driver, 20)  
    
    
    elemnt=wait.until(EC.presence_of_element_located((By.XPATH, "//body/div[@id='wrapper']/div[@id='content']/div[@class='tenders']/div[@class='form-group']/div[1]/div[1]//i")))
        elemnt.click()
        elemnt1=wait.until(EC.presence_of_element_located((By.XPATH, "//div[@class='form-group']//div[1]//div[3]//table[1]//tbody[1]//tr[6]//td[1]")))
        elemnt1.click()
        lists=wait.until(EC.presence_of_all_elements_located((By.XPATH, "//table[@class='tenders-table cloned']")))
        for element in lists:
             print element.text
    

提交回复
热议问题