What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-27 13:27:02
image from wikipedia module in python
import wikipedia import requests import json WIKI_REQUEST = 'http://en.wikipedia.org/w/api.php?action=query&prop=pageimages&format=json&piprop=original&titles=' def get_wiki_image(search_term): try: result = wikipedia.search(... Add solution -
TypeScript 2021-09-19 18:01:03
python requests firefox headers
import requests url = 'http://www.ichangtou.com/#company:data_000008.html' headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'} response = requests.get(url, ... Add solution -
Python 2021-09-18 18:06:03
get table wikipedia
import requests from bs4 import BeautifulSoup URL = "https://en.wikipedia.org/wiki/List_of_current_heads_of_state_and_government" res = requests.get(URL).text soup = BeautifulSoup(res,'lxml') for items in soup.find('table', class_='wikitable')... Add solution -
Python 2021-09-18 16:37:05
python - exchange rate API
import requests APP_ID = "**********************" ENDPOINT = "https://openxchangerates.org/latest.json" response = requests.get(f"{ENDPOINT}?app_id={APP:ID}") exchange_rate = response.json()["rates"] usd_amount = 1... Add solution