Skip to main content
edited body
Source Link
Andersson
  • 52.8k
  • 18
  • 84
  • 133

The link text is exact text of the link you see on web page while partial link text is just some substring of that link text.

"services.ics" is part of href attribute. If you want to find element by "services.ics" you might use

driver.find_element_by_xpath('//a[contains(@href, "services.ics")]')

Also you might use title attribute to match required element:

driver.find_element_by_xpath('//a[@title="iCal Feed"]')

Note that

element = driver.findElement(By.cssSelector("a[href*='services.ics']")).click();

is Java analogue of Python code

from selenium.webdriver.common.by import By 
element = driver.find_element(By.CSS_SELECTOR, "a[href*='services.ics']").click();

Update

Link might be generated dynamically, so you can try to apply ExplicitWait as below to avoid NoSuchElementException:

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait as wait

wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//a[@title="iCal Feed"]'))).click()

Update 2

As target link located inside an iframe you should switch to that frame before clicking link:

wait(driver, 10).until(EcEC.frame_to_be_available_and_switch_to_it("trumba.spud.1.iframe"))
driver.find_element_by_xpath('//a[@title="iCal Feed"]').click()

The link text is exact text of the link you see on web page while partial link text is just some substring of that link text.

"services.ics" is part of href attribute. If you want to find element by "services.ics" you might use

driver.find_element_by_xpath('//a[contains(@href, "services.ics")]')

Also you might use title attribute to match required element:

driver.find_element_by_xpath('//a[@title="iCal Feed"]')

Note that

element = driver.findElement(By.cssSelector("a[href*='services.ics']")).click();

is Java analogue of Python code

from selenium.webdriver.common.by import By 
element = driver.find_element(By.CSS_SELECTOR, "a[href*='services.ics']").click();

Update

Link might be generated dynamically, so you can try to apply ExplicitWait as below to avoid NoSuchElementException:

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait as wait

wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//a[@title="iCal Feed"]'))).click()

Update 2

As target link located inside an iframe you should switch to that frame before clicking link:

wait(driver, 10).until(Ec.frame_to_be_available_and_switch_to_it("trumba.spud.1.iframe"))
driver.find_element_by_xpath('//a[@title="iCal Feed"]').click()

The link text is exact text of the link you see on web page while partial link text is just some substring of that link text.

"services.ics" is part of href attribute. If you want to find element by "services.ics" you might use

driver.find_element_by_xpath('//a[contains(@href, "services.ics")]')

Also you might use title attribute to match required element:

driver.find_element_by_xpath('//a[@title="iCal Feed"]')

Note that

element = driver.findElement(By.cssSelector("a[href*='services.ics']")).click();

is Java analogue of Python code

from selenium.webdriver.common.by import By 
element = driver.find_element(By.CSS_SELECTOR, "a[href*='services.ics']").click();

Update

Link might be generated dynamically, so you can try to apply ExplicitWait as below to avoid NoSuchElementException:

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait as wait

wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//a[@title="iCal Feed"]'))).click()

Update 2

As target link located inside an iframe you should switch to that frame before clicking link:

wait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it("trumba.spud.1.iframe"))
driver.find_element_by_xpath('//a[@title="iCal Feed"]').click()
added 279 characters in body
Source Link
Andersson
  • 52.8k
  • 18
  • 84
  • 133

The link text is exact text of the link you see on web page while partial link text is just some substring of that link text.

"services.ics" is part of href attribute. If you want to find element by "services.ics" you might use

driver.find_element_by_xpath('//a[contains(@href, "services.ics")]')

Also you might use title attribute to match required element:

driver.find_element_by_xpath('//a[@title="iCal Feed"]')

Note that

element = driver.findElement(By.cssSelector("a[href*='services.ics']")).click();

is Java analogue of Python code

from selenium.webdriver.common.by import By 
element = driver.find_element(By.CSS_SELECTOR, "a[href*='services.ics']").click();

Update

Link might be generated dynamically, so you can try to apply ExplicitWait as below to avoid NoSuchElementException:

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait as wait

wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//a[@title="iCal Feed"]'))).click()

Update 2

As target link located inside an iframe you should switch to that frame before clicking link:

wait(driver, 10).until(Ec.frame_to_be_available_and_switch_to_it("trumba.spud.1.iframe"))
driver.find_element_by_xpath('//a[@title="iCal Feed"]').click()

The link text is exact text of the link you see on web page while partial link text is just some substring of that link text.

"services.ics" is part of href attribute. If you want to find element by "services.ics" you might use

driver.find_element_by_xpath('//a[contains(@href, "services.ics")]')

Also you might use title attribute to match required element:

driver.find_element_by_xpath('//a[@title="iCal Feed"]')

Note that

element = driver.findElement(By.cssSelector("a[href*='services.ics']")).click();

is Java analogue of Python code

from selenium.webdriver.common.by import By 
element = driver.find_element(By.CSS_SELECTOR, "a[href*='services.ics']").click();

Update

Link might be generated dynamically, so you can try to apply ExplicitWait as below to avoid NoSuchElementException:

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait as wait

wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//a[@title="iCal Feed"]'))).click()

The link text is exact text of the link you see on web page while partial link text is just some substring of that link text.

"services.ics" is part of href attribute. If you want to find element by "services.ics" you might use

driver.find_element_by_xpath('//a[contains(@href, "services.ics")]')

Also you might use title attribute to match required element:

driver.find_element_by_xpath('//a[@title="iCal Feed"]')

Note that

element = driver.findElement(By.cssSelector("a[href*='services.ics']")).click();

is Java analogue of Python code

from selenium.webdriver.common.by import By 
element = driver.find_element(By.CSS_SELECTOR, "a[href*='services.ics']").click();

Update

Link might be generated dynamically, so you can try to apply ExplicitWait as below to avoid NoSuchElementException:

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait as wait

wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//a[@title="iCal Feed"]'))).click()

Update 2

As target link located inside an iframe you should switch to that frame before clicking link:

wait(driver, 10).until(Ec.frame_to_be_available_and_switch_to_it("trumba.spud.1.iframe"))
driver.find_element_by_xpath('//a[@title="iCal Feed"]').click()
added 511 characters in body
Source Link
Andersson
  • 52.8k
  • 18
  • 84
  • 133

The link text is exact text of the link you see on web page while partial link text is just some substring of that link text.

"services.ics" is part of href attribute. If you want to find element by "services.ics" you might use

driver.find_element_by_xpath('//a[contains(@href, "services.ics")]')

Also you might use title attribute to match required element:

driver.find_element_by_xpath('//a[@title="iCal Feed"]')

Note that

element = driver.findElement(By.cssSelector("a[href*='services.ics']")).click();

is Java analogue of Python code

from selenium.webdriver.common.by import By 
element = driver.find_element(By.CSS_SELECTOR, "a[href*='services.ics']").click();

Update

Link might be generated dynamically, so you can try to apply ExplicitWait as below to avoid NoSuchElementException:

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait as wait

wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//a[@title="iCal Feed"]'))).click()

The link text is exact text of the link you see on web page while partial link text is just some substring of that link text.

"services.ics" is part of href attribute. If you want to find element by "services.ics" you might use

driver.find_element_by_xpath('//a[contains(@href, "services.ics")]')

Also you might use title attribute to match required element:

driver.find_element_by_xpath('//a[@title="iCal Feed"]')

Note that

element = driver.findElement(By.cssSelector("a[href*='services.ics']")).click();

is Java analogue of Python code

from selenium.webdriver.common.by import By 
element = driver.find_element(By.CSS_SELECTOR, "a[href*='services.ics']").click();

The link text is exact text of the link you see on web page while partial link text is just some substring of that link text.

"services.ics" is part of href attribute. If you want to find element by "services.ics" you might use

driver.find_element_by_xpath('//a[contains(@href, "services.ics")]')

Also you might use title attribute to match required element:

driver.find_element_by_xpath('//a[@title="iCal Feed"]')

Note that

element = driver.findElement(By.cssSelector("a[href*='services.ics']")).click();

is Java analogue of Python code

from selenium.webdriver.common.by import By 
element = driver.find_element(By.CSS_SELECTOR, "a[href*='services.ics']").click();

Update

Link might be generated dynamically, so you can try to apply ExplicitWait as below to avoid NoSuchElementException:

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait as wait

wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//a[@title="iCal Feed"]'))).click()
added 279 characters in body
Source Link
Andersson
  • 52.8k
  • 18
  • 84
  • 133
Loading
Source Link
Andersson
  • 52.8k
  • 18
  • 84
  • 133
Loading