示例#1
0
class TestIndexItem(demiurge.Item):
    title = demiurge.TextField(selector='h1')
    items_following_link = demiurge.RelatedItem(TestItem,
                                                selector='a.link',
                                                attr='href')
    next_page = demiurge.RelatedItem('self', selector='a.next', attr='href')

    class Meta:
        base_url = 'http://localhost'
示例#2
0
文件: api.py 项目: matiasb/fpt-cli
class Standings(demiurge.Item):
    rows = demiurge.RelatedItem(StandingsRow)

    class Meta:
        selector = 'div.posiciones table.table'
        encoding = 'utf-8'
        base_url = BASE_URL + 'posiciones.html'
示例#3
0
文件: api.py 项目: matiasb/fpt-cli
class Relegation(demiurge.Item):
    rows = demiurge.RelatedItem(RelegationRow)

    class Meta:
        selector = 'div.descenso table.table'
        encoding = 'utf-8'
        base_url = BASE_URL + 'descenso.html'
示例#4
0
class SteamCart(demiurge.Item):
    count = demiurge.TextField(selector='span#cart_item_count_value')
    subtotal = demiurge.TextField(selector='div#cart_price_total')
    balance = demiurge.TextField(selector='a#header_wallet_balance')

    cart_status_message = demiurge.TextField(selector='div.cart_status_message')
    cart_checkout_button = demiurge.AttributeValueField(selector='a.continue:eq(0)', attr='href')

    items = demiurge.RelatedItem(SteamCartItem, selector='div.cart_item_list')
示例#5
0
文件: api.py 项目: matiasb/fpt-cli
class Round(demiurge.Item):
    _css_class = demiurge.AttributeValueField(attr='class')
    title = demiurge.TextField(selector='div.subHeader')
    matches = demiurge.RelatedItem(Match)

    class Meta:
        selector = 'div.fase div.fecha'
        encoding = 'utf-8'
        base_url = BASE_URL + 'fixture.html'

    @property
    def is_current(self):
        return 'show' in self._css_class
示例#6
0
class GoogleShoppingItem (demiurge.Item):
    #url = demiurge.AttributeValueField (selector='td:eq(2) a:eq(1)', attr='href')
    #name = demiurge.TextField(selector='td:eq(2) a:eq(2)')
    #size = demiurge.TextField(selector='td:eq(3)')

    heading = demiurge.TextField(selector='.pslires h3')  #'.pslmain h3')
    image   = demiurge.AttributeValueField (selector='.pslires .psliimg img', attr='alt')
    link    = demiurge.AttributeValueField (selector='.pslires h3 a', attr='href')
    price   = demiurge.TextField(selector='.pslires div b:contains("$")')  #'.pslline price') # best price, usually 30-40% lower than avg
    rows    = demiurge.RelatedItem (ItemPriceDetailRow, selector=".pslires h3 a", attr="href")
    #main   = demiurge.TextField(selector='.pslmain')

    class Meta:
        #selector = '.pslicont' #'table.maintable:gt(0) tr:gt(0)'
        selector = '.pslires' #'table.maintable:gt(0) tr:gt(0)'
        base_url = 'https://www.google.com'  #'http://www.mininova.org'
示例#7
0
class TestInnerItem(demiurge.Item):
    inner_items = demiurge.RelatedItem(TestItem)

    class Meta:
        base_url = 'http://localhost'
        selector = "div.section"
示例#8
0
class SteamGiftInventory(demiurge.Item):
    gifts = demiurge.RelatedItem(SteamGift)

    class Meta:
        selector = 'div#tabcontent_pendinggifts'