I don't know if it's what you're searching, you can do :
for i in range(1, loops_count + 1):
browser.execute_script(f"arguments[{i}].scrollTop = arguments[{i}].scrollHeight", followers_ul)
Adding f"{variable}" to a string is a simple way to have a string with variable. In this case, it will replace in the string the i the loop count. If it's not that, could you precise your question ?
发布评论
评论(1)
我不知道这是否是您要搜索的,您可以做:
将f“ {variable}”添加到字符串中是一种简单的方法,即使具有变量的字符串。
在这种情况下,它将在字符串中替换为i循环计数。
如果不是这样,您能确定您的问题吗?
I don't know if it's what you're searching, you can do :
Adding f"{variable}" to a string is a simple way to have a string with variable.
In this case, it will replace in the string the i the loop count.
If it's not that, could you precise your question ?