Fix Wikipedia request user agent

copilot/fix-issue-with-791
copilot-swe-agent[bot] 2 weeks ago committed by GitHub
parent 717876b09a
commit d565afd42d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -44,7 +44,12 @@
"source": [
"import requests\r\n",
"\r\n",
"text = requests.get(url).content.decode('utf-8')\r\n",
"headers = {\r\n",
" 'User-Agent': 'DataScienceForBeginners/1.0 (https://github.com/microsoft/Data-Science-For-Beginners)'\r\n",
"}\r\n",
"response = requests.get(url, headers=headers)\r\n",
"response.raise_for_status()\r\n",
"text = response.content.decode('utf-8')\r\n",
"print(text[:1000])"
],
"outputs": [

Loading…
Cancel
Save