使用Selenium-如何在特定列中迭代Trello卡?

所以还没有代码,但是没有人知道w / Selenium:

1)检查Trello卡是否在特定列中。 (是的,我知道XPATH和选择器:)) 2)迭代该卡存在时该列中的所有卡(以执行涉及每张卡的操作)。

我想用Selenium自动化工作项目(我相当满意,但我不知道如何遍历Trello列中的元素。

谢谢!

topten800 回答:使用Selenium-如何在特定列中迭代Trello卡?

Trello入门需要一些粗糙的Python代码-这个问题很笼统,所以我不确定您的最终目标是什么:

from selenium import webdriver

# navigate to trello
driver = webdriver.Chrome();
driver.get("https://trello.com/b/hLMqdeiE/welcome-to-trello")

# you probably need to log in here
# select a board?

# get list of cards in a column
# 'Things To Do' is the name of my list in trello.
cards_for_column = driver.find_elements_by_xpath("//div[textarea[text()='Things To Do']]/following-sibling::div[contains(@class,'list-cards')]/a")

for card in cards_for_column:

    # print URL to edit the card
    print(card.get_attribute("href"))

如果您想获得更具体的答案,最好自己开始,这样我们就可以更好地了解您要在这里做什么。

本文链接:https://www.f2er.com/3115184.html

大家都在问