From 5774ecc2f866146d8bd756338b4ede02ffab237c Mon Sep 17 00:00:00 2001 From: sinclairh Date: Sun, 26 Oct 2025 20:27:10 -0700 Subject: [PATCH] removing a code block that doesn't work anymore, and updating some wording --- doc/source/user_guide/io.rst | 47 +----------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index 5b25462568cfa..3f59ad2faae08 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -2366,52 +2366,7 @@ Read a URL with no options: The data from the above URL changes every Monday so the resulting data above may be slightly different. -Read a URL while passing headers alongside the HTTP request: - -.. code-block:: ipython - - In [322]: url = 'https://www.sump.org/notes/request/' # HTTP request reflector - - In [323]: pd.read_html(url) - Out[323]: - [ 0 1 - 0 Remote Socket: 51.15.105.256:51760 - 1 Protocol Version: HTTP/1.1 - 2 Request Method: GET - 3 Request URI: /notes/request/ - 4 Request Query: NaN, - 0 Accept-Encoding: identity - 1 Host: www.sump.org - 2 User-Agent: Python-urllib/3.8 - 3 Connection: close] - - In [324]: headers = { - .....: 'User-Agent':'Mozilla Firefox v14.0', - .....: 'Accept':'application/json', - .....: 'Connection':'keep-alive', - .....: 'Auth':'Bearer 2*/f3+fe68df*4' - .....: } - - In [325]: pd.read_html(url, storage_options=headers) - Out[325]: - [ 0 1 - 0 Remote Socket: 51.15.105.256:51760 - 1 Protocol Version: HTTP/1.1 - 2 Request Method: GET - 3 Request URI: /notes/request/ - 4 Request Query: NaN, - 0 User-Agent: Mozilla Firefox v14.0 - 1 AcceptEncoding: gzip, deflate, br - 2 Accept: application/json - 3 Connection: keep-alive - 4 Auth: Bearer 2*/f3+fe68df*4] - -.. note:: - - We see above that the headers we passed are reflected in the HTTP request. - -Read in the content of the file from the above URL and pass it to ``read_html`` -as a string: +Read in HTML content from a file using ``read_html``: .. ipython:: python