QA服务sli.do的解析页面:
import urllib.request
from bs4 import BeautifulSoup
voting_url = "https://app.sli.do/event/i6jqiqxm/live/questions"
voting_page = urllib.request.urlopen(voting_url)
soup = BeautifulSoup(voting_page, 'lxml')
print(soup.prettify())
for link in soup.find_all('span'):
print(link.get('Linkify'))
print(soup.prettify())
返回html文档,但没有包含包含问题文本的标记span
{
您可以在动态生成数据时浏览api。如果访问令牌部分也发生动态变化,那么您可能需要找出它
输出:
相关问题 更多 >
编程相关推荐