def get_drupal_plugins():
    r = urllib2.Request("https://www.drupal.org/project/project_module/index")
    content = urllib2.urlopen(r)

    tree = html.fromstring(content.read())
    links = tree.xpath('//*[@id="block-system-main"]/div/div/div/div[2]/div/ol/li/div/span/a')
    modules = []

    for el in links:
        # lxml.etree.Element stores attributes in a dict interface
        string = el.get('href')
        module = string.replace("/project", "modules")
        modules.append(module)

    with open("%s/drupal_plugins.txt.new" % CMS_EXPLORER_DIR, "w+") as file:
        for module in modules:
            file.write("%s\n" % module.encode('ascii','ignore'))
    print("Drupal plugins list updated!")
dataset/ETHPy150Open owtf/owtf/scripts/update_cms_explorer_lists.py/get_drupal_plugins/original