在这个社区(link)的帮助下,我能够找到一个特定版本的seldon (1.7.0)是否存在于(https://pypi.org/project/pyorg/)中。
但我想不出我们怎么点击那个版本。
发布于 2021-11-28 12:18:27
您需要为包含该版本的元素创建定位器。下面的代码可以点击找到的链接。
driver.get("https://pypi.org/project/seldon-core/#history")
text = "1.7.0"
if(text in element.text for element in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "p.release__version")))):
print("Version found. Clicking on the version")
elementLink = driver.find_element(By.XPATH, "//*[@class='release__version' and contains(.,'"+text+"')]")
elementLink.click()
else:
print("Version not found")
driver.quit()输出:

https://stackoverflow.com/questions/70140443
复制相似问题