I need to set a loop. I need to set the loop from
tr[1] to tr[10] and every time I need to get back to the dashboard. Please help me doing this.
driver.find_element(By.XPATH, (‘/html/body/div/div[3]/table[1]/tbody/**tr[1]/**td[8]/a’)).click();
#Here is the code
driver.find_element(By.XPATH, ('/html/body/div/div[3]/table[1]/tbody/tr[1]/td[8]/a')).click();
driver.find_element(By.XPATH, ('//*[@id="tabPayment"]')).click();
driver.find_element(By.XPATH, ('/html/body/div/div[3]/div[4]/div[1]/ul/li[3]/a')).click();
driver.find_element(By.XPATH, ('/html/body/div/div[3]/div[4]/table/tbody/tr[2]/td[3]/a')).click();
driver.find_element(By.XPATH, ('/html/body/div/div[3]/table[2]/tbody/tr[2]/td[4]/a')).click();
#Extracting Data
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0",
"Accept-Encoding": "*",
"Connection": "keep-alive",
}
page = driver.page_source
soup = BeautifulSoup(page,'html.parser')
TID = soup.find(text= "Tender/Proposal ID :").findNext('td')
print("TID=", TID.text)
#Getting Back to Dashboard
movemouse = driver.find_element(By.XPATH,"//a[@id='headTabEval']");
achains = ActionChains(driver)
achains.move_to_element(movemouse).perform()
time.sleep(1)
dashboard_url = driver.find_element(By.XPATH,"//a[normalize-space()='Evaluation Committee']").click();
time.sleep(5)
