Skip to content

Instantly share code, notes, and snippets.

@fasalmbt
Created January 6, 2021 20:03
Show Gist options
  • Save fasalmbt/ea4ec3cc42bd83ba625f5bdc9dc32d97 to your computer and use it in GitHub Desktop.
Save fasalmbt/ea4ec3cc42bd83ba625f5bdc9dc32d97 to your computer and use it in GitHub Desktop.
Scrape the value of currency from google search and print it in indian rupees
import requests as r
from bs4 import BeautifulSoup
currency = input("Enter the Currency and value >> ")
search = "Value of {} in rupees".format(currency)
url = f"https://www.google.com/search?&q={search}"
req = r.get(url)
http_data = BeautifulSoup(req.text, "html.parser")
temp = http_data.find("div", class_='BNeawe').text
print(temp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment