{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import requests\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#perform same get request as that of a web browser\n",
"req = requests.get(\"https://www.google.com\")\n",
"print(req.content)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'Date': 'Sat, 05 Mar 2022 02:48:38 GMT', 'Expires': '-1', 'Cache-Control': 'private, max-age=0', 'Content-Type': 'text/html; charset=ISO-8859-1', 'P3P': 'CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"', 'Content-Encoding': 'gzip', 'Server': 'gws', 'X-XSS-Protection': '0', 'X-Frame-Options': 'SAMEORIGIN', 'Set-Cookie': '1P_JAR=2022-03-05-02; expires=Mon, 04-Apr-2022 02:48:38 GMT; path=/; domain=.google.com; Secure, NID=511=G6o1HE7Nb0VAs6KFi_QbHdxEkWD2TVuDTQTgB4Jprnqg3YT3YpWs3Qs4dnzeL-xi2FCx0PGRi9mQbrMjHHQ8gC9GIcdSBjOZitw_gaXjq-6EkJUAG5ZhhSoPiCf5ZGH0HDrENPmnp2_7wCYh1cvT5_lCZ9zf-kbJE6bYtau0xgI; expires=Sun, 04-Sep-2022 02:48:38 GMT; path=/; domain=.google.com; HttpOnly', 'Alt-Svc': 'h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"', 'Transfer-Encoding': 'chunked'}\n"
]
}
],
"source": [
"print(req.headers)\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"