V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  Droi  ›  全部回复第 5 页 / 共 5 页
回复总数  83
1  2  3  4  5  
2017-08-18 10:37:58 +08:00
回复了 holajamc 创建的主题 Python 求问网页标签获取
你是不是想要这些内容。
我是熬两次汤,熬出来的。不知道其他人有没有其他好用的方法。
官方教程的快速开始有这个 get()方法

from bs4 import BeautifulSoup
>>> html = """<html> ..... </html>"""
>>> soup = BeautifulSoup(html, "html.parser")
>>> ssoup = BeautifulSoup(str(soup.find_all(attrs={'class':'story'})), "html.parser")
>>> ssoup.find_all('a')[0].get('href')
'http://example.com/elsie'
>>>
先把桌号从你的支付数据库移除。暂时先让桌号只做简单的事,帮上菜的人知道应该把菜送到哪里。
1  2  3  4  5  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5124 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 03:49 · PVG 11:49 · LAX 20:49 · JFK 23:49
Developed with CodeLauncher
♥ Do have faith in what you're doing.