Skip to content

Instantly share code, notes, and snippets.

@josben
Created March 29, 2016 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josben/714cdf8ce9f9a56f0eda to your computer and use it in GitHub Desktop.
Save josben/714cdf8ce9f9a56f0eda to your computer and use it in GitHub Desktop.
Este scraping agarra todos los docentes de www.cs.umss.edu.bo y los pone en una lista
import requests
from bs4 import BeautifulSoup
response = requests.get('http://www.cs.umss.edu.bo/rep_docentes.jsp')
soup = BeautifulSoup(response.text, "lxml")
td_docentes = soup.findAll('td', {'class': 'letra_central', 'width': '65%'})
docentes = []
for row in soup.findAll('td', {'class': 'letra_central', 'width': '65%'}):
for col in row.find_all('a'):
docentes.append(row.get_text())
title = 'Docentes'
print title
print '=' * len(title) + '\n'
for docente in docentes:
print('Docente: ' + (docente.strip()).rstrip())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment