How to simulate a click on Linkedin with selenium. Problem: dynamic id / uses ember

0

Good morning, I'm trying to click on the 'Show more' button in the skills field but without any success. The xpath is dynamic, and by class also does not work. The button seems to be hidden somehow.

I tried xpath:

driver.find_element_by_xpath('//*[@id="ember2605"]/button/span[2]/li-icon/svg/path').click()

Thanks for the help

    
asked by anonymous 21.04.2018 / 15:19

1 answer

0

Hello, apparently Linkedin forces you to use Xpath, since Selenium (today, 24/04/18) does not allow you to find by composite classes.

so you'll need to search for:

driver.find_elements_by_xpath("//*[contains(@id,'ember']))

Search for all elements whose xpath starts with 'ember'. Note that using Xpath remains the same, so you can use as usual: adding more paths forward.

What will become problematic because it will bring useless things together, but that is what solves.

I hope I have helped.

Att, Willy of the past.

    
25.04.2018 / 04:16