Diferencia entre revisiones de «LSWC scraping the web/taller scraping lwsc 2011»

De WikiEducator
Saltar a: navegación, buscar
Línea 21: Línea 21:
 
TOCdepth=2|
 
TOCdepth=2|
 
Title=Lectura básica de un documento|
 
Title=Lectura básica de un documento|
 +
<source lang="python" line="GESHI_NORMAL_LINE_NUMBERS" >
 +
from amara.bindery import html
 +
URL = 'http://mypage.com'
 +
 +
doc = html.parse(URL)
 +
 
}}
 
}}

Revisión de 02:21 7 nov 2011


Actividad

Icon objectives.jpg

Objetivo

  • Introducción a las técnicas básicas de scraping usando Python y Amara
  • Herramientas de ayuda (firebug, curl, ...)


Configuración del entorno

Icon activity.jpg

Configuración del entorno

  • Instalación de amara
$ sudo pip install http://files.akara.info/00-amara-latest.tar.bz2
Icon present.gif
Tip: Es necesario tener instalado un compilador de C y la cabeceras de python (en debian/ubuntu hay que instalar python-dev)


  • Instalar firebug
https://addons.mozilla.org/es-es/firefox/addon/firebug/





{{Actividad| TOCdepth=2| Title=Lectura básica de un documento|

  1. from amara.bindery import html
  2. URL = 'http://mypage.com'
  3.  
  4. doc = html.parse(URL)
  5.  
  6. }}