当前位置: 首页>>代码示例>>Python>>正文


Python LegistarScraper._get_link_address方法代码示例

本文整理汇总了Python中legistar.scraper.LegistarScraper._get_link_address方法的典型用法代码示例。如果您正苦于以下问题:Python LegistarScraper._get_link_address方法的具体用法?Python LegistarScraper._get_link_address怎么用?Python LegistarScraper._get_link_address使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在legistar.scraper.LegistarScraper的用法示例。


在下文中一共展示了LegistarScraper._get_link_address方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: link_address_is_none

# 需要导入模块: from legistar.scraper import LegistarScraper [as 别名]
# 或者: from legistar.scraper.LegistarScraper import _get_link_address [as 别名]
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)
开发者ID:randikp23,项目名称:legistar-scrape,代码行数:10,代码来源:test_legistar_scraper.py

示例2: link_address_is_onclick

# 需要导入模块: from legistar.scraper import LegistarScraper [as 别名]
# 或者: from legistar.scraper.LegistarScraper import _get_link_address [as 别名]
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")
开发者ID:hughdbrown,项目名称:legistar-scrape,代码行数:11,代码来源:test_legistar_scraper.py

示例3: link_address_is_none

# 需要导入模块: from legistar.scraper import LegistarScraper [as 别名]
# 或者: from legistar.scraper.LegistarScraper import _get_link_address [as 别名]
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)
开发者ID:hughdbrown,项目名称:legistar-scrape,代码行数:11,代码来源:test_legistar_scraper.py

示例4: link_address_is_href

# 需要导入模块: from legistar.scraper import LegistarScraper [as 别名]
# 或者: from legistar.scraper.LegistarScraper import _get_link_address [as 别名]
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")
开发者ID:hughdbrown,项目名称:legistar-scrape,代码行数:11,代码来源:test_legistar_scraper.py

示例5: link_address_is_onclick

# 需要导入模块: from legistar.scraper import LegistarScraper [as 别名]
# 或者: from legistar.scraper.LegistarScraper import _get_link_address [as 别名]
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")
开发者ID:randikp23,项目名称:legistar-scrape,代码行数:12,代码来源:test_legistar_scraper.py


注:本文中的legistar.scraper.LegistarScraper._get_link_address方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。