Aug-14-2018, 10:48 AM
Here is my code segment -
for clk in range(1, int(lim)):
for i in range(1, 101):
tab_str = '//*[@id="tbody_other_search"]/tr['
tab_str = tab_str + str(i) + ']/td[1]'
print(tab_str)
driver.find_element_by_xpath(tab_str).text()
'''if int(num) % 100 == int(en_dig):
print(num)'''
driver.find_element_by_xpath('//*[@id="names_load_next"]/a/i').click()
WebDriverWait(driver,5)I confirmed that the correct xpath is generated in tab_str by the printing the xpath but getting the error for the line -driver.find_element_by_xpath(tab_str).text()and here is the error -
Error:driver.find_element_by_xpath(tab_str).text()
TypeError: 'str' object is not callableWhat is the reason of error? please share with me.
