back-end/threats_monitoring/botscout.py
def scrape_it(html_code):
    """ Scrapes all the need data from the downloaded web page
        @parameter
            html_code    (str)   html source code (never None) of downloaded page
        @return
            bot_entries  (list)  list of all scraped values
    """

    tree = fromstring(html_code)

    bot_entries = []
    content = tree.xpath('//td/text()')[6:]
    ip = tree.xpath('//td/a/text()')
    country = tree.xpath('//td/a/img/@title')

    num_rows = len(ip)

    for i in range(0, num_rows):
        position_of_entry = i*4
        row = [ip[i]] + [country[i]] + content[position_of_entry:position_of_entry+4]
        bot_entries.append(row)
        # print(i, position_of_entry, position_of_entry+1, position_of_entry+2, position_of_entry+3, row)

    return bot_entries
 Scrapes all the need data from the downloaded web page
        @parameter
            html_code    (str)   html source code (never None) of downloaded page
        @return
            bot_entries  (list)  list of all scraped values
    
Scrapes all the need data from the downloaded web page
@parameter
html_code    (str)   html source code (never None) of downloaded page
@return
bot_entries  (list)  list of all scraped values
Scrapes all the need data from the downloaded web page @parameter html_code ( str ) html source code ( never None ) of downloaded page @return bot_entries ( list ) list of all scraped values
def scrape_it(html_code):
    tree = fromstring(html_code)
    bot_entries = []
    content = tree.xpath('//td/text()')[6:]
    ip = tree.xpath('//td/a/text()')
    country = tree.xpath('//td/a/img/@title')
    num_rows = len(ip)
    for i in range(0, num_rows):
        position_of_entry = i*4
        row = [ip[i]] + [country[i]] + content[position_of_entry:position_of_entry+4]
        bot_entries.append(row)
    return bot_entries
def scrape_it ( html_code ) : tree = fromstring ( html_code ) bot_entries = [ ] content = tree . xpath ( '//td/text()' ) [ 6 : ] ip = tree . xpath ( '//td/a/text()' ) country = tree . xpath ( '//td/a/img/@title' ) num_rows = len ( ip ) for i in range ( 0 , num_rows ) : position_of_entry = i * 4 row = [ ip [ i ] ] + [ country [ i ] ] + content [ position_of_entry : position_of_entry + 4 ] bot_entries . append ( row ) return bot_entries
Scrapes all the need data from the downloaded web page
@parameter
html_code    (str)   html source code (never None) of downloaded page
@return
bot_entries  (list)  list of all scraped values
Scrapes all the need data from the downloaded web page @parameter html_code ( str ) html source code ( never None ) of downloaded page @return bot_entries ( list ) list of all scraped values
""" Scrapes all the need data from the downloaded web page
        @parameter
            html_code    (str)   html source code (never None) of downloaded page
        @return
            bot_entries  (list)  list of all scraped values
    """ # print(i, position_of_entry, position_of_entry+1, position_of_entry+2, position_of_entry+3, row)

html_code