nicolomantini / LinkedIn-Easy-Apply-Bot

Automate the application process on LinkedIn
Apache License 2.0
795 stars 322 forks source link

Getting the following error: Unable to locate element "preceding sibling" #127

Closed ba2512005 closed 1 year ago

ba2512005 commented 1 year ago

Describe the bug

Message: no such element: Unable to locate element: {"method":"xpath","selector":"preceding-sibling::*"} (Session info: chrome=111.0.5563.147)

00:48:11 - INFO - Message: no such element: Unable to locate element: {"method":"xpath","selector":"preceding-sibling::*"} (Session info: chrome=111.0.5563.147)

00:48:11 - INFO - cannot apply to this job Screenshots If applicable, add screenshots of the LinkedIn page you are attempting to apply to.

Logs If applicable, attach your logs file found in ./logs/

Error Statement If applicable and not stated above, provide the error statement you are receiving.

Desktop (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. right before it finishes applying this code comes up

Expected behavior A clear and concise description of what you expected to happen. it should hit submit application but it says it can't complete it

Additional context Add any other context about the problem here.

angelaaaateng commented 1 year ago

I'm also getting the same error--were you able to solve this please?

IntrovertedFL commented 1 year ago

I'm also getting the same error, I hope this can be fixed.

lucasloboguerrero commented 1 year ago

Same error here, I had to fix this line input_field = self.browser.find_element("xpath", "//input[contains(@name,'phoneNumber')]")

for this

input_field = self.browser.find_element(By.CSS_SELECTOR, "input.artdeco-text-input--input[type='text']")

ddao07 commented 1 year ago

@lucasloboguerrero Unfortunately, that didn't work for me, it just put in my phone number into the field for first name.

mnewls commented 1 year ago

swapping:

upload_locator = (By.CSS_SELECTOR, "button[aria-label='DOC, DOCX, PDF formats only (5 MB).']")

and:

sibling = parent.find_element(By.XPATH, "preceding-sibling::*[1]")

worked out for me.

I have the input_field defined as below:

input_field = self.browser.find_element(By.CSS_SELECTOR, "input.artdeco-text-input--input[type='text']")

lmk if this works out for you.

ba2512005 commented 1 year ago

Awesome work @mnewls, that worked!

ba2512005 commented 1 year ago

reopening for visibility.

Fixed repo here: https://github.com/ba2512005/LinkedIn-Easy-Apply-Bot