We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
main
https://pandas.pydata.org/docs/dev/user_guide/io.html#reading-html-content
Read in the content of the file from the above URL and pass it to read_html as a string: In [317]: html_str = """ .....: <table> .....: <tr> .....: <th>A</th> .....: <th colspan="1">B</th> .....: <th rowspan="1">C</th> .....: </tr> .....: <tr> .....: <td>a</td> .....: <td>b</td> .....: <td>c</td> .....: </tr> .....: </table> .....: """ .....: In [318]: with open("tmp.html", "w") as f: .....: f.write(html_str) .....: In [319]: df = pd.read_html("tmp.html") In [320]: df[0] Out[320]: A B C 0 a b c
Read in the content of the file from the above URL and pass it to read_html as a string:
read_html
In [317]: html_str = """ .....: <table> .....: <tr> .....: <th>A</th> .....: <th colspan="1">B</th> .....: <th rowspan="1">C</th> .....: </tr> .....: <tr> .....: <td>a</td> .....: <td>b</td> .....: <td>c</td> .....: </tr> .....: </table> .....: """ .....: In [318]: with open("tmp.html", "w") as f: .....: f.write(html_str) .....: In [319]: df = pd.read_html("tmp.html") In [320]: df[0] Out[320]: A B C 0 a b c
The "above URL" is
url = 'https://www.sump.org/notes/request/' # HTTP request reflector
but data from that URL is not what's used in the code.
"pass it to read_html as a string" is not what's being demonstrated in the code.
read_html can take an HTML string, but that behaviour is deprecated, per its docs:
Deprecated since version 2.1.0: Passing html literal strings is deprecated. Wrap literal string/bytes input in io.StringIO/io.BytesIO instead.
io.StringIO
io.BytesIO
I'm not sure!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Pandas version checks
main
hereLocation of the documentation
https://pandas.pydata.org/docs/dev/user_guide/io.html#reading-html-content
Documentation problems
Problem 1
The "above URL" is
but data from that URL is not what's used in the code.
Problem 2
"pass it to
read_html
as a string" is not what's being demonstrated in the code.Problem 3
read_html
can take an HTML string, but that behaviour is deprecated, per its docs:Suggested fix for documentation
I'm not sure!
The text was updated successfully, but these errors were encountered: