html_content = """
<span style="font-size:14px"><a href="blog.yhat.com/posts/visualize-nba-pipelines.html" rel="external nofollow" target="_blank" style="color: #1173C7;text-decoration: underline;font-weight: bold;">Data Wrangling 101: Using Python to Fetch, Manipulate & Visualize NBA Data</a></span><br>
A tutorial using pandas and a few other packages to build a simple datapipe for getting NBA data. Even though this tutorial is done using NBA data, you don't need to be an NBA fan to follow along. The same concepts and techniques can be applied to any project of your choosing.<br>
"""
A tutorial using pandas and a few other packages to build a simple datapipe
for getting NBA data. Even though this tutorial is done using NBA data, you
don't need to be an NBA fan to follow along. The same concepts and techniques
can be applied to any project of your choosing.
--ignore-images
h.ignore_images = True
print h.handle('<p>This is a img: <img src="my.oschina.net/img/hot3.png" style="max-height: 32px; max-width: 32px;" alt="hot3"> ending ...</p>')
输出为:
This is a img: ending ...
--images-to-alt
h.images_to_alt = True
print h.handle('<p>This is a img: <img src="my.oschina.net/img/hot3.png" style="max-height: 32px; max-width: 32px;" alt="hot3"> ending ...</p>')
输出为:
This is a img: hot3 ending ...
--images-with-size
h.images_with_size = True
print h.handle('<p>This is a img: <img src="my.oschina.net/img/hot3.png" height=32px width=32px alt="hot3"> ending ...</p>')
输出为:
This is a img: <img src='my.oschina.net/img/hot3.png' width='32px'
height='32px' alt='hot3' /> ending ...
--body-width
h.body_width=0
print h.handle(html_content)
输出为:
[Data Wrangling 101: Using Python to Fetch, Manipulate & Visualize NBA Data](blog.yhat.com/posts/visualize-nba-pipelines.html)
A tutorial using pandas and a few other packages to build a simple datapipe for getting NBA data. Even though this tutorial is done using NBA data, you don't need to be an NBA fan to follow along. The same concepts and techniques can be applied to any project of your choosing.
html_content = """
<span style="font-size:14px"><a href="blog.yhat.com/posts/visualize-nba-pipelines.html" rel="external nofollow" target="_blank" style="color: #1173C7;text-decoration: underline;font-weight: bold;">Data Wrangling 101: Using Python to Fetch, Manipulate & Visualize NBA Data</a></span><br>
A tutorial using pandas and a few other packages to build a simple datapipe for getting NBA data. Even though this tutorial is done using NBA data, you don't need to be an NBA fan to follow along. The same concepts and techniques can be applied to any project of your choosing.<br>
"""
A tutorial using pandas and a few other packages to build a simple datapipe
for getting NBA data. Even though this tutorial is done using NBA data, you
don't need to be an NBA fan to follow along. The same concepts and techniques
can be applied to any project of your choosing.
--ignore-images
h.ignore_images = True
print h.handle('<p>This is a img: <img src="my.oschina.net/img/hot3.png" style="max-height: 32px; max-width: 32px;" alt="hot3"> ending ...</p>')
输出为:
This is a img: ending ...
--images-to-alt
h.images_to_alt = True
print h.handle('<p>This is a img: <img src="my.oschina.net/img/hot3.png" style="max-height: 32px; max-width: 32px;" alt="hot3"> ending ...</p>')
输出为:
This is a img: hot3 ending ...
--images-with-size
h.images_with_size = True
print h.handle('<p>This is a img: <img src="my.oschina.net/img/hot3.png" height=32px width=32px alt="hot3"> ending ...</p>')
输出为:
This is a img: <img src='my.oschina.net/img/hot3.png' width='32px'
height='32px' alt='hot3' /> ending ...
--body-width
h.body_width=0
print h.handle(html_content)
输出为:
[Data Wrangling 101: Using Python to Fetch, Manipulate & Visualize NBA Data](blog.yhat.com/posts/visualize-nba-pipelines.html)
A tutorial using pandas and a few other packages to build a simple datapipe for getting NBA data. Even though this tutorial is done using NBA data, you don't need to be an NBA fan to follow along. The same concepts and techniques can be applied to any project of your choosing.