Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
raspado web; ¿Cómo renderizar html después de ejecutar javascript?

Estoy tratando de obtener una lista de empresas de tecnología en Greater Noida de 'GlassDoor':

pero Problema: la página cambia su contenido después de algunos segundos de carga (puede estar usando javascript).

Enlace: https://www.glassdoor.co.in/Explore/browse-companies.htm?overall_rating_low=3.5&page=1&isHiringSurge=0&locId=4475367&locType=C&locName=Greater%20Noida

puede cambiar el valor de la página en el enlace... pruébelo. después de cambiar la página no. Estoy renderizando el mismo contenido de la primera página... ¡después de cambiar el número de página!

 from bs4 import BeautifulSoup from selenium import webdriver lst=[] options = webdriver.ChromeOptions() options.add_argument('--headless') browser = webdriver.Chrome(options=options, executable_path='chromedriver.exe') browser.get("https://www.glassdoor.co.in/Explore/browse-companies.htm?overall_rating_low=3.5&page=8&isHiringSurge=0&locId=4475367&locType=C&locName=Greater%20Noida") html = browser.page_source soup = BeautifulSoup(html, features="html.parser") company_lst = soup.find_all('section', {'class': 'employerCard__EmployerCardStyles__employerCard'}) for item in company_lst: d={} d['Name'] = item.find('h2', {'data-test': 'employer-short-name'}).text d['Rating'] = item.find('span', {'data-test': 'rating'}).text d['Reviews-Count'] = item.find('div', {'data-test': 'cell-Reviews-count'}).text d['Salaries-Count'] = item.find('div', {'data-test': 'cell-Salaries-count'}).text d['Jobs-Count'] = item.find('div', {'data-test': 'cell-Jobs-count'}).text d['Industry'] = item.find('span', {'data-test': 'employer-industry'}).text print(d['Name'])
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No estoy seguro de por qué la página se vuelve a cargar a la primera página. Pero puede intentar hacer clic en los botones de número de página como se muestra a continuación (que funciona bien).

 browser.get("https://www.glassdoor.co.in/Explore/browse-companies.htm?overall_rating_low=3.5&page=1&isHiringSurge=0&locId=4475367&locType=C&locName=Greater%20Noida") for i in range(2,8): browser.find_element_by_xpath("//ul[contains(@class,'pagination')]//li/button[text()='{}']".format(i)).click() print(browser.current_url) # Prints the URL from page 2 to 7. time.sleep(5)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!