我需要使用Python连续获得最新条目的价值



我正在尝试使用python上的硒自动化一个过程。

我需要在搜索栏中搜索一个帐户。要输入的值将存储在Excel文件中,并每次搜索新帐户时都会更新。

inputElement = driver.find_element_by_id("ctl00_tbxAcctSearch")
inputElement.send_keys('Value to be added here to search which is stored in excel')

我有一个想法,我需要将值存储在变量中,然后在inputElement.send_keys('variable')中获取变量 - 但我不知道该怎么做。

我认为,如果您必须定期搜索一个帐户,则必须迭代该Excel文件中的条目。

因此,在您提到的想法中,变量是list。基本上,您必须将条目存储在excel文件中的列表中, account_to_search_list变量,然后迭代它:

for i in range(0, len(account_to_search_list)):
  '''do standard selenium path or button searching here''' # Do what you have to do here- which browser element you need to click or check for existence, etc.
  inputElement.send_keys('account_to_search_list[i]')

最新更新