@@ -2366,52 +2366,7 @@ Read a URL with no options:
23662366
23672367 The data from the above URL changes every Monday so the resulting data above may be slightly different.
23682368
2369- Read a URL while passing headers alongside the HTTP request:
2370-
2371- .. code-block :: ipython
2372-
2373- In [322]: url = 'https://www.sump.org/notes/request/' # HTTP request reflector
2374-
2375- In [323]: pd.read_html(url)
2376- Out[323]:
2377- [ 0 1
2378- 0 Remote Socket: 51.15.105.256:51760
2379- 1 Protocol Version: HTTP/1.1
2380- 2 Request Method: GET
2381- 3 Request URI: /notes/request/
2382- 4 Request Query: NaN,
2383- 0 Accept-Encoding: identity
2384- 1 Host: www.sump.org
2385- 2 User-Agent: Python-urllib/3.8
2386- 3 Connection: close]
2387-
2388- In [324]: headers = {
2389- .....: 'User-Agent':'Mozilla Firefox v14.0',
2390- .....: 'Accept':'application/json',
2391- .....: 'Connection':'keep-alive',
2392- .....: 'Auth':'Bearer 2*/f3+fe68df*4'
2393- .....: }
2394-
2395- In [325]: pd.read_html(url, storage_options=headers)
2396- Out[325]:
2397- [ 0 1
2398- 0 Remote Socket: 51.15.105.256:51760
2399- 1 Protocol Version: HTTP/1.1
2400- 2 Request Method: GET
2401- 3 Request URI: /notes/request/
2402- 4 Request Query: NaN,
2403- 0 User-Agent: Mozilla Firefox v14.0
2404- 1 AcceptEncoding: gzip, deflate, br
2405- 2 Accept: application/json
2406- 3 Connection: keep-alive
2407- 4 Auth: Bearer 2*/f3+fe68df*4]
2408-
2409- .. note ::
2410-
2411- We see above that the headers we passed are reflected in the HTTP request.
2412-
2413- Read in the content of the file from the above URL and pass it to ``read_html ``
2414- as a string:
2369+ Read in HTML content from a file using ``read_html ``:
24152370
24162371.. ipython :: python
24172372
0 commit comments