Did I find the right examples for you? yes no

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)
Controller class to manage url and retrieve content using BeautifulSoup.

Created on 27/09/2012

@author: Ricardo García Fernández
@mail: ricardogarfe@gmail.com

src/r/i/ricardo_crawler-01.00.01/test/controllers/TestUrlContentRetrieve.py   ricardo_crawler(Download)
 
import unittest
from controllers.url_content_retrieve import UrlContentRetrieve
from urllib2 import URLError
 
 
        starting_url = "http://localhost"
        url_content_retrieve = UrlContentRetrieve(starting_url)
 
        # Test 1
        # Initialize object
        starting_url = "http://non-existing-url.com"
        url_content_retrieve = UrlContentRetrieve(starting_url)
 
        # Test 1 - Variables
        # Test 2 - enconding
        starting_url = "http://es.wikipedia.org"
        url_content_retrieve = UrlContentRetrieve(starting_url)
        target_url = \
            "http://es.wikipedia.org/wiki/Depresi%C3%B3n_tropical_Diez_(2007)"