How to simulate a click on Linkedin with Selenium. Problem: dynamic id / uses Ember

Asked

Viewed 56 times

0

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

I tried to xpath:

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

inserir a descrição da imagem aqui

Thanks for the help

1 answer

0

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

so you’ll need to search for:

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

look for all elements whose xpath starts with 'Ember'. Note that the use of Xpath remains the same, so you can use as always: adding more paths ahead.

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

I hope I’ve helped.

Att, Willy of the past.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.