TypeError: 'WebElement' object is not callable
TypeError: 'WebElement' object is not callable
你好,我有一些代码可以检查 link 是否正常,但我不能 运行 它。
links = driver.find_elements_by_partial_link_text('')
l = links[random.randint(0, len(links)-1)]
while "profile" in l():
print("finding new link")
links = driver.find_elements_by_partial_link_text('')
l = links[random.randint(0, len(links) - 1)]
l.click()
因为当我 运行 它时我得到错误:
while "profile" in l():
TypeError: 'WebElement' object is not callable
import random
links = driver.find_elements_by_partial_link_text('')
l = links[random.randint(0, len(links)-1)]
while True:
if l.text.find("profile") >= 0:
print("finding new link")
links = driver.find_elements_by_partial_link_text('')
l = links[random.randint(0, len(links) - 1)]
else:
break;
l.click()
你好,我有一些代码可以检查 link 是否正常,但我不能 运行 它。
links = driver.find_elements_by_partial_link_text('')
l = links[random.randint(0, len(links)-1)]
while "profile" in l():
print("finding new link")
links = driver.find_elements_by_partial_link_text('')
l = links[random.randint(0, len(links) - 1)]
l.click()
因为当我 运行 它时我得到错误:
while "profile" in l():
TypeError: 'WebElement' object is not callable
import random
links = driver.find_elements_by_partial_link_text('')
l = links[random.randint(0, len(links)-1)]
while True:
if l.text.find("profile") >= 0:
print("finding new link")
links = driver.find_elements_by_partial_link_text('')
l = links[random.randint(0, len(links) - 1)]
else:
break;
l.click()