コード例 #1
0
ファイル: test_bsoup4.py プロジェクト: jeffreywinn/jabbapylib
def test_get_links():
    soup = bs.to_soup(ex.LINKS)
    links = bs.get_links(soup, 'http://retrogames.com')
    assert links == ['http://retrogames.com', 'http://retrogames.com/games/elite', 'http://retrogames.com/games/commando']
    #
    links = bs.get_links(soup)
    assert links == ['http://retrogames.com', '/games/elite', '/games/commando']
コード例 #2
0
def test_get_links():
    soup = bs.to_soup(ex.LINKS)
    links = bs.get_links(soup, 'http://retrogames.com')
    assert links == [
        'http://retrogames.com', 'http://retrogames.com/games/elite',
        'http://retrogames.com/games/commando'
    ]
    #
    links = bs.get_links(soup)
    assert links == [
        'http://retrogames.com', '/games/elite', '/games/commando'
    ]
コード例 #3
0
def test_make_links_absolute():
    soup = bs.to_soup(ex.LINKS)
    soup = bs.make_links_absolute(soup, 'http://retrogames.com')
    #
    links = bs.get_links(soup)
    assert links == ['http://retrogames.com', 'http://retrogames.com/games/elite', 'http://retrogames.com/games/commando']
    
コード例 #4
0
def test_make_links_absolute():
    soup = bs.to_soup(ex.LINKS)
    soup = bs.make_links_absolute(soup, 'http://retrogames.com')
    #
    links = bs.get_links(soup)
    assert links == [
        'http://retrogames.com', 'http://retrogames.com/games/elite',
        'http://retrogames.com/games/commando'
    ]