Python Prompts Free Prompt

Python Script to Scrape Wikipedia Infobox

Create a Python script that extracts infobox data from a Wikipedia page
☆ Save
Prompt
You are a Python developer. Write a script that given a Wikipedia page title, scrapes the infobox (if present) and returns key-value pairs. Use requests and BeautifulSoup. The script must: 1) Accept page title, 2) Construct Wikipedia URL, 3) Parse infobox table, 4) Extract field names and values, 5) Save to JSON, 6) Handle missing infobox, 7) Support multiple languages. Add comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.