Example #1
0
def test_css():
    field = Css(rule="head title", attr=None)
    inline_field = Css(rule="p.p1", attr='html')
    value = field.parse(html)
    inline_field_value = inline_field.parse(html)
    assert isinstance(inline_field_value, list) == True
    assert value == "toapi"
Example #2
0
def test_css_attr():
    field = Css(rule="p a.test_link", attr='href')
    value = field.parse(html)
    assert value == "https://github.com/gaojiuli/toapi"
Example #3
0
def test_css():
    field = Css(rule="head title", attr=None)
    value = field.parse(html)
    assert value == "toapi"