Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created March 20, 2020 20:10
Show Gist options
  • Save aniruddha27/e818eadd962fbdb3fb657a81c52ea80a to your computer and use it in GitHub Desktop.
Save aniruddha27/e818eadd962fbdb3fb657a81c52ea80a to your computer and use it in GitHub Desktop.
import requests
from bs4 import BeautifulSoup
# url
# url = "https://weather.com/en-IN/weather/tenday/l/aff9460b9160c73ff01769fd83ae82cf37cb27fb7eb73c70b91257d413147b69"
url = "https://en.wikipedia.org/wiki/Delhi"
# Package the request, send the request and catch the response: r
r = requests.get(url)
# Extracts the response as html: html_doc
html_doc = r.text
# Create a BeautifulSoup object from the HTML: soup
soup = BeautifulSoup(html_doc)
# Print the response
print(soup.prettify())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment