-1

How to click in the link in a herf and the link is string

<a href="/pages/creation_flow/?step=profile_pic&amp;draft_id=597215097432581&amp;page_id=11020432423337" class="inv" id="u_0_1_sX" data-sigil="no_mpc">تخطي</a>

2 Answers2

0

Generally, it can be done by clicking the element itself.
In case this locator is correct and unique you can do it as following:

driver.find_element_by_xpath('//a[contains(@href,"/pages/creation_flow/?step=profile_pic")]').click()

I can't be sure about the locator since you dint share a link to the page or the entire page HTML.
Also you probably will need to add some delay before accessing it.

Prophet
  • 32,350
  • 22
  • 54
  • 79
0

To click on the element with text as تخطي you can use either of the following Locator Strategies:

  • Using link_text:

    driver.find_element(By.LINK_TEXT, "تخطي")
    
  • Using css_selector:

    driver.find_element(By.CSS_SELECTOR, "a.inv[href^='/pages/creation_flow/?step=profile_pic']").click()
    
  • Using xpath:

    driver.find_element(By.XPATH, "//a[@class='inv' and starts-with(@href, '/pages/creation_flow/?step=profile_pic')][text()='تخطي']").click()
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352