扫码关注官方订阅号
http://www.pythonscraping.com/pages/page3.html
人生最曼妙的风景,竟是内心的淡定与从容!
html=''' <table border="1"> <tr> <td>python cookbook</td> <td>gun</td> </tr> <tr> <td>book</td> <td>toy</td> </tr> <tr> <td>$25</td> <td>$21</td> </tr> </table> ''' from bs4 import BeautifulSoup soup=BeautifulSoup(html) trs=soup.find_all('tr') print trs[0].text,trs[2].text
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
人生最曼妙的风景,竟是内心的淡定与从容!