本文整理汇总了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)
示例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")
示例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)
示例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")
示例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")