text_plain_output_1.png
from wikipedia.exceptions import PageError

import pandas as pd

import wikipedia

topic_list = ['Application Security', 'Backup Business Continuity and Recovery', 'Change Control', 'Communication Security', 'Cryptography', 'Encryption and Key Management', 'Data Security', 'Endpoint Security', 'General Security', 'Governance', 'Risk and Compliance', 'Human Centric Security', 'Identity and Access Management', 'Infrastructure and Virtualization Security', 'Mobile Security', 'Network Security', 'Physical and Facility Security', 'Security Operations Center', 'Forensics and Incident Response', 'Threat and Vulnerability Management', 'Web Security']
result = []
count = 0
def create_data(search_term):
    results_list = wikipedia.search(search_term, results=20)
    wiki_search_results = []
    for each_result in results_list:
        wiki_page_result = {}
        try:
            wiki_page_obj = wikipedia.page(each_result)
        except PageError:
            continue
        except wikipedia.DisambiguationError as e:
            s = 1
            p = wikipedia.page(s)
        wiki_page_result['title'] = wiki_page_obj.title
        wiki_page_result['content'] = wiki_page_obj.content
        wiki_page_result['url'] = wiki_page_obj.url
        wiki_page_result['links'] = wiki_page_obj.links
        wiki_search_results.append(wiki_page_result)
    return wiki_search_results
for index in topic_list:
    outcome = create_data(index)
    result.append(outcome)
    count += 1

p = []
for i in result:
    for j in i:
        p.append(j)

final_df = pd.DataFrame(p)

final_df.shape