Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

335
Visualizações
Can not Find Elements on the production Server, Selenium

this question might seem dumb but I am facing a problem regarding finding of elements in Facebook. The issue is I want to change the language of the user so I go to the tab to change language and there is a drop-down(dynamic as I read on internet) and you can change language but when you click on the drop-down and enter the class name (or id or xpath or selectors) it does not show that any element is present there, but when I inspect those elements , the code renders and then I can find the elements in the Dev Tools using the same class(id or xpath or selectors).

When I run the code in my local machine(uses remote browser), the bot goes to drop-down, clicks on it and executes the line to find the options of the drop-down, and it successfully finds the 114 options and clicks on the desired one but the main problem occurs when I want to use the same code on a production server (Scaleaway server and also remote browser), the length of the list of the elements find out to be zero and hence the code breaks.

URL to change Language of the account: https://www.facebook.com/settings/?tab=language

Details for Image : These are the HTML tags and code related to this drop down, only appears when I specifically inspect the element and box, but when I close the drop down and enter the same id or selector I inspected , I get no elements related to it , Selenium somehow does find through my local machine but fails with the server side code

languages = self.browser.find_elements_by_xpath(
            '//span[contains(@class,"d2edcug0 hpfvmrgz qv66sw1b c1et5uql lr9zc1uh 
            a8c37x1j fe6kdd0r mau55g9w c8b282yb keod5gw0 nxhoafnm aigsh9s9 d3f4x2em 
            iv3no6db jq4qci2q a3bd9o3v ekzkrbhg oo9gr5id hzawbc8m")]')
sleep(2)
print(f" Languages found: {len(languages)}")

I get length of the list as 114 through my local machine but 0 with server.

Can any one figure this out and how can I use Selenium to solve this issue ?

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda