Hey guys I am working on an automating bot for adding connections in LinkedIn, recently I encountered a problem for finding the "Connect" element(button) after searching in the search box and filtering for "People only".
That is the inspect of the relevant part:
<div id="ember374" class="ember-view">
<button id="ember378" class="artdeco-button artdeco-button--2 artdeco-button--secondary ember-view" data-control-name="entity_action_primary" data-control-id="AQT4G2UkQk6LQlbdf6XySw==">
<!---->
<span class="artdeco-button__text">Connect</span></button>
This is my tries for clicking on that "connect" element:
1. CONNECT_BUTTON_SEARCH_PAGE = "//*[contains(@class,'artdeco-button__text') and contains(.,'Connect')]"
2. CONNECT_BUTTON_SEARCH_PAGE = "//*[text()='Connect']"
3. CONNECT_BUTTON_SEARCH_PAGE = "//button[contains(. , ’Connect’)]"
WebDriverWait(self.driver, 5).until(EC.presence_of_element_located(
(By.XPATH, Xpath.CONNECT_BUTTON_SEARCH_PAGE))).click()
I have to mention that it works fine in the "Network" page, but I want it to add connections after searching a key word. So when I'm searching people according to a special key word, in that page I don't find the "Connect" button
I don`t know why but I can not reach for that element, appreciate if someone could help me