File tree Expand file tree Collapse file tree 4 files changed +37
-45
lines changed
Get_Content_From_Wikipedia Expand file tree Collapse file tree 4 files changed +37
-45
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import wikipediaapi
2+
3+ def get_wikipedia_content (page_title ):
4+ wiki_wiki = wikipediaapi .Wikipedia ('en' )
5+ page = wiki_wiki .page (page_title )
6+
7+ if page .exists ():
8+ return page .text
9+ else :
10+ return f"Page '{ page_title } ' does not exist on Wikipedia."
11+
12+ def main ():
13+ page_title = input ("Enter the Wikipedia page title: " )
14+ content = get_wikipedia_content (page_title )
15+
16+ print (f"\n Content from Wikipedia for '{ page_title } ':\n " )
17+ print (content )
18+
19+ if __name__ == "__main__" :
20+ main ()
Original file line number Diff line number Diff line change 1+ # Get_Content_From_Wikipedia
2+
3+ Short description of package/script
4+
5+ - This Script Was simple to setup
6+ - Need import wikipedia-api
7+
8+
9+ ## Setup instructions
10+
11+
12+ Just Need to run this command "pip install wikipedia-api
13+ " then run the Get_Content_From_Wikipedia.py file and for running python3 is must be installed!
14+
15+ ## Detailed explanation of script, if needed
16+
17+ This Script Is Only for Get_Content_From_Wikipedia use only!
You can’t perform that action at this time.
0 commit comments