scrape.read_table_pages

Here are the examples of the python api scrape.read_table_pages taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

Example 1

Project: regenesis Source File: statistic.py
def load_variables(stat_id):
    url = config.url("?sequenz=statistikMerkmale&selectionname=%s&sprache=de" % stat_id)
    for tr in scrape.read_table_pages(url):
        td = tr.find('td')
        if td:
            yield td.find('div').contents[0]

Example 2

Project: regenesis Source File: variable.py
Function: all
def all():
    def _generate():
        for tr in scrape.read_table_pages(config.url("?operation=merkmaleVerzeichnis")):
            td = tr.find('td')
            if not td: continue
            if td.string:
                #print td.string.encode('utf-8')
                yield td.string.encode('utf-8')
            else:
                yield td.find('a').get('id').encode('utf-8')
    
    [get(i) for i in _generate()]

Example 3

Project: regenesis Source File: terms.py
def terms_it():
    for tr in scrape.read_table_pages(config.url("?operation=begriffeVerzeichnis")):
        yield tr.findAll('a')[0].get('id')

Example 4

Project: regenesis Source File: variable.py
def load_variable_tables(href):
    for tr in scrape.read_table_pages(href):
        yield tr.find('a').get('id')