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


Python link_crawler.LinkCrawler类代码示例

本文整理汇总了Python中pages.link_crawler.LinkCrawler的典型用法代码示例。如果您正苦于以下问题:Python LinkCrawler类的具体用法?Python LinkCrawler怎么用?Python LinkCrawler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: test_that_links_in_the_events_page_return_200_code

    def test_that_links_in_the_events_page_return_200_code(self, mozwebqa):
        crawler = LinkCrawler(mozwebqa)
        urls = crawler.collect_links("/events/")

        Assert.greater(len(urls), 0, "The link crawler did not find any urls to crawl")

        all_ok, bad_urls = crawler.verify_status_codes_are_ok(urls)
        Assert.true(all_ok, "%s bad links found. " % len(bad_urls) + ", ".join(bad_urls))
开发者ID:brettrann,项目名称:remo-tests,代码行数:8,代码来源:test_events_page.py

示例2: test_that_links_in_the_events_page_return_200_code

    def test_that_links_in_the_events_page_return_200_code(self, mozwebqa):
        crawler = LinkCrawler(mozwebqa)
        urls = crawler.collect_links('/events/', id='wrapper')

        Assert.greater(len(urls), 0,
            'The link crawler did not find any urls to crawl')

        all_ok, bad_urls = crawler.verify_status_codes_are_ok(urls)
        Assert.true(all_ok, '%s bad links found. ' % len(bad_urls) + ', '.join(bad_urls))
开发者ID:bobsilverberg,项目名称:remo-tests,代码行数:9,代码来源:test_events_page.py

示例3: test_that_links_in_footer_return_200_code

    def test_that_links_in_footer_return_200_code(self, base_url):
        crawler = LinkCrawler(base_url)
        urls = crawler.collect_links("/", name="footer")
        bad_urls = []

        assert len(urls) > 0

        for url in urls:
            check_result = crawler.verify_status_code_is_ok(url)
            if check_result is not True:
                bad_urls.append(check_result)

        assert 0 == len(bad_urls), u"%s bad links found. " % len(bad_urls) + ", ".join(bad_urls)
开发者ID:dav1do,项目名称:mozillians-tests,代码行数:13,代码来源:test_account.py

示例4: test_that_links_in_the_faq_page_return_200_code

    def test_that_links_in_the_faq_page_return_200_code(self, mozwebqa):
        crawler = LinkCrawler(mozwebqa)
        urls = crawler.collect_links("/faq/", id="wrapper")
        bad_urls = []

        Assert.greater(len(urls), 0, "The link crawler did not find any urls to crawl")

        for url in urls:
            check_result = crawler.verify_status_code_is_ok(url)
            if check_result is not True:
                bad_urls.append(check_result)

        Assert.equal(0, len(bad_urls), "%s bad links found. " % len(bad_urls) + ", ".join(bad_urls))
开发者ID:AlinT,项目名称:remo-tests,代码行数:13,代码来源:test_faq_page.py

示例5: test_that_links_in_the_about_page_return_200_code

    def test_that_links_in_the_about_page_return_200_code(self, base_url):
        crawler = LinkCrawler(base_url)
        urls = crawler.collect_links('/about', id='main')
        bad_urls = []

        assert len(urls) > 0

        for url in urls:
            check_result = crawler.verify_status_code_is_ok(url)
            if check_result is not True:
                bad_urls.append(check_result)

        assert 0 == len(bad_urls), u'%s bad links found. ' % len(bad_urls) + ', '.join(bad_urls)
开发者ID:davehunt,项目名称:mozillians-tests,代码行数:13,代码来源:test_about_page.py

示例6: test_that_links_in_the_about_page_return_200_code

    def test_that_links_in_the_about_page_return_200_code(self, mozwebqa):
        crawler = LinkCrawler(mozwebqa)
        urls = crawler.collect_links("/about", id="main")
        bad_urls = []

        Assert.greater(len(urls), 0, u"something went wrong. no links found.")

        for url in urls:
            check_result = crawler.verify_status_code_is_ok(url)
            if check_result is not True:
                bad_urls.append(check_result)

        Assert.equal(0, len(bad_urls), u"%s bad links found. " % len(bad_urls) + ", ".join(bad_urls))
开发者ID:AlexLakatos,项目名称:mozillians-tests,代码行数:13,代码来源:test_about_page.py

示例7: test_home_page_links

    def test_home_page_links(self, mozwebqa):
        crawler = LinkCrawler(mozwebqa)
        urls = crawler.collect_links('/', id='content')
        bad_urls = []

        Assert.greater(len(urls), 0, u'Something went wrong. No links found.')

        for url in urls:
            check_result = crawler.verify_status_code_is_ok(url)
            if check_result is not True:
                bad_urls.append(check_result)

        Assert.equal(
            0, len(bad_urls),
            u'%s bad links found. ' % len(bad_urls) + ', '.join(bad_urls))
开发者ID:bairob767,项目名称:qmo-tests,代码行数:15,代码来源:test_home.py

示例8: test_that_links_in_the_about_page_return_200_code

    def test_that_links_in_the_about_page_return_200_code(self, base_url):
        crawler = LinkCrawler(base_url)
        urls = crawler.collect_links('/about', id='main')
        bad_urls = []

        Assert.greater(
            len(urls), 0, u'something went wrong. no links found.')

        for url in urls:
            check_result = crawler.verify_status_code_is_ok(url)
            if check_result is not True:
                bad_urls.append(check_result)

        Assert.equal(
            0, len(bad_urls),
            u'%s bad links found. ' % len(bad_urls) + ', '.join(bad_urls))
开发者ID:ithompson4,项目名称:mozillians-tests,代码行数:16,代码来源:test_about_page.py

示例9: test_that_links_in_footer_return_200_code

    def test_that_links_in_footer_return_200_code(self, mozwebqa):
        crawler = LinkCrawler(mozwebqa)
        urls = crawler.collect_links('/', name='footer')
        bad_urls = []

        Assert.greater(
            len(urls), 0, u'something went wrong. no links found.')

        for url in urls:
            check_result = crawler.verify_status_code_is_ok(url)
            if check_result is not True:
                bad_urls.append(check_result)

        Assert.equal(
            0, len(bad_urls),
            u'%s bad links found. ' % len(bad_urls) + ', '.join(bad_urls))
开发者ID:nurgl10,项目名称:mozillians-tests,代码行数:16,代码来源:test_account.py

示例10: test_community_page_links

    def test_community_page_links(self, mozwebqa):
        crawler = LinkCrawler(mozwebqa)
        urls = crawler.collect_links('/community', id='activity-stream')
        bad_urls = []

        Assert.greater(
            len(urls), 0, u'something went wrong. no links found.')

        for url in urls:
            if not 'irc://irc.mozilla.org' and not 'mailto:' in url:
                check_result = crawler.verify_status_code_is_ok(url)
                if check_result is not True:
                    bad_urls.append(check_result)

        Assert.equal(
            0, len(bad_urls),
            u'%s bad links found. ' % len(bad_urls) + ', '.join(bad_urls))
开发者ID:amitverma12,项目名称:qmo-tests,代码行数:17,代码来源:test_community.py

示例11: test_that_links_in_the_labs_page_return_200_code

    def test_that_links_in_the_labs_page_return_200_code(self, mozwebqa):
        crawler = LinkCrawler(mozwebqa)
        urls = crawler.collect_links('/labs/', id='wrapper')
        bad_urls = []

        Assert.greater(
            len(urls), 0,
            'The link crawler did not find any urls to crawl')

        for url in urls:
            check_result = crawler.verify_status_code_is_ok(url)
            if check_result is not True:
                bad_urls.append(check_result)

        Assert.equal(
            0, len(bad_urls),
            '%s bad links found. ' % len(bad_urls) + ', '.join(bad_urls))
开发者ID:AlinT,项目名称:remo-tests,代码行数:17,代码来源:test_labs_page.py

示例12: test_that_links_in_the_services_page_return_200_code

    def test_that_links_in_the_services_page_return_200_code(self, base_url, selenium, vouched_user):
        home_page = Home(base_url, selenium)
        home_page.login(vouched_user['email'], vouched_user['password'])

        settings = home_page.header.click_settings_menu_item()
        developer = settings.developer
        crawler = LinkCrawler(base_url)
        urls = developer.get_services_urls()
        bad_urls = []

        assert len(urls) > 0

        for url in urls:
            check_result = crawler.verify_status_code_is_ok(url)
            if check_result is not True:
                bad_urls.append(check_result)

        assert 0 == len(bad_urls), u'%s bad links found. ' % len(bad_urls) + ', '.join(bad_urls)
开发者ID:akatsoulas,项目名称:mozillians-tests,代码行数:18,代码来源:test_profile.py

示例13: test_that_links_in_the_services_page_return_200_code

    def test_that_links_in_the_services_page_return_200_code(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.login()

        edit_profile_page = home_page.header.click_edit_profile_menu_item()
        crawler = LinkCrawler(mozwebqa)
        urls = edit_profile_page.get_services_urls()
        bad_urls = []

        Assert.greater(
            len(urls), 0, u'something went wrong. no links found.')

        for url in urls:
            check_result = crawler.verify_status_code_is_ok(url)
            if check_result is not True:
                bad_urls.append(check_result)

        Assert.equal(
            0, len(bad_urls),
            u'%s bad links found. ' % len(bad_urls) + ', '.join(bad_urls))
开发者ID:nurgl10,项目名称:mozillians-tests,代码行数:20,代码来源:test_profile.py


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