Skip to content

Commit d478fa7

Browse files
Merge pull request #2880 from Kalivarapubindusree/sathi
Get_Content_From_Wikipedia added
2 parents b37fd54 + 9b063ff commit d478fa7

File tree

4 files changed

+37
-45
lines changed

4 files changed

+37
-45
lines changed

Filter_Text/Filter_Text.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

Filter_Text/README.md

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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"\nContent from Wikipedia for '{page_title}':\n")
17+
print(content)
18+
19+
if __name__ == "__main__":
20+
main()

Get_Content_From_Wikipedia/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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!

0 commit comments

Comments
 (0)