コード例 #1
0
ファイル: test_scraper.py プロジェクト: svenkreiss/localcrawl
    def test_link(self):
        c = localcrawl.Scraper()
        html = c.html('tests/data/linked_page/index.html')
        self.assertIn('<title>Linked Page</title>', html)

        urls = c.link_urls('tests/data/linked_page/index.html')
        self.assertIn('page2.html', urls[0])
コード例 #2
0
ファイル: test_scraper.py プロジェクト: svenkreiss/localcrawl
    def test_index_chrome(self):
        chrome_options = selenium.webdriver.chrome.options.Options()
        chrome_options.add_argument('--headless')
        driver = selenium.webdriver.Chrome(chrome_options=chrome_options)

        c = localcrawl.Scraper(driver)
        url = 'file://' + os.getcwd() + '/tests/data/simple_site/index.html'
        html = c.html(url)
        self.assertIn('<title>Simple Site</title>', html)
コード例 #3
0
ファイル: test_scraper.py プロジェクト: svenkreiss/localcrawl
 def test_index(self):
     c = localcrawl.Scraper()
     html = c.html('tests/data/simple_site/index.html')
     self.assertIn('<title>Simple Site</title>', html)