Esempio n. 1
0
def link_address_is_none():
    config = Config(hostname='phila.legistar.com',
                    sponsor_links=False).defaults(DEFAULT_CONFIG)
    scraper = LegistarScraper(config)
    from BeautifulSoup import BeautifulSoup
    link = BeautifulSoup('<html><a></a></html>').find('a')
    address = scraper._get_link_address(link)
    assert_is_none(address)
def link_address_is_none():
    config = Config(hostname="phila.legistar.com", sponsor_links=False).defaults(DEFAULT_CONFIG)
    scraper = LegistarScraper(config)
    from BeautifulSoup import BeautifulSoup

    link = BeautifulSoup("<html><a></a></html>").find("a")
    address = scraper._get_link_address(link)
    assert_is_none(address)
def link_address_is_none():
    config = {"hostname": "phila.legistar.com", "fulltext": True}
    scraper = LegistarScraper(config)

    from BeautifulSoup import BeautifulSoup

    link = BeautifulSoup("<html><a></a></html>").find("a")
    address = scraper._get_link_address(link)
    assert_is_none(address)
def link_address_is_onclick():
    config = {"hostname": "phila.legistar.com", "fulltext": True}
    scraper = LegistarScraper(config)

    from BeautifulSoup import BeautifulSoup

    link = BeautifulSoup("<html><a onclick=\"radopen('http://www.google.com');\"></a></html>").find("a")
    address = scraper._get_link_address(link)
    assert_equal(address, "http://www.google.com")
def link_address_is_href():
    config = {"hostname": "phila.legistar.com", "fulltext": True}
    scraper = LegistarScraper(config)

    from BeautifulSoup import BeautifulSoup

    link = BeautifulSoup('<html><a href="http://www.google.com"></a></html>').find("a")
    address = scraper._get_link_address(link)
    assert_equal(address, "http://www.google.com")
def link_address_is_onclick():
    config = Config(hostname="phila.legistar.com", sponsor_links=False).defaults(DEFAULT_CONFIG)

    scraper = LegistarScraper(config)

    from BeautifulSoup import BeautifulSoup

    link = BeautifulSoup("<html><a onclick=\"radopen('http://www.google.com');\"></a></html>").find("a")
    address = scraper._get_link_address(link)
    assert_equal(address, "http://www.google.com")
Esempio n. 7
0
def link_address_is_href():
    config = Config(hostname='phila.legistar.com',
                    sponsor_links=False).defaults(DEFAULT_CONFIG)

    scraper = LegistarScraper(config)

    from BeautifulSoup import BeautifulSoup
    link = BeautifulSoup(
        '<html><a href="http://www.google.com"></a></html>').find('a')
    address = scraper._get_link_address(link)
    assert_equal(address, 'http://www.google.com')