def test_html_page_should_be_able_to_scrap_rel_links(): """ Test scraping page looking for url in href """ page = HTMLPage( """ <!-- The <th> elements below are a terrible terrible hack for setuptools --> <li> <strong>Home Page:</strong> <!-- <th>Home Page --> <a href="http://supervisord.org/">http://supervisord.org/</a> </li>""", "supervisor") links = list(page.scraped_rel_links()) assert len(links) == 1 assert links[0].url == 'http://supervisord.org/'
def test_base_url(html, url, expected): assert HTMLPage(html, url).base_url == expected