0

With the help of this community(link), I was able to find whether a particular version of seldon-core (1.7.0) existed in (https://pypi.org/project/pyorg/).

But I was not able to figure out how do we click on that version.

vajr1
  • 27
  • 5

1 Answers1

1

You need to create your locator for that element containing that version. Below code is able to click on the found link.

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()

Output:

enter image description here

QualityMatters
  • 895
  • 11
  • 31