Created
January 6, 2021 20:03
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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