【发布时间】:2017-03-05 03:21:27
【问题描述】:
晚上好,伙计们。 我正在尝试使用请求和 BeautifulSoup 获取一些 html 元素。使用请求的内容作为解析器的参数,我想在股票价格历史网站上获得最终报价。此信息存储在此链接 (https://iqoption.com/pt/historical-financial-quotes?active_id=1&tz_offset=-180&date=2017-3-4-0-0) 中的“quotes-table-result__val”类中。但是,该脚本返回一个 None 对象。你知道我做错了什么吗?
代码:
from bs4 import BeautifulSoup
import requests
r = requests.get('https://iqoption.com/pt/historical-financial-quotes?active_id=1&tz_offset=-180&date=2017-3-4-0-0')
soup = BeautifulSoup(r.content, 'html5lib')
final_quotation = soup.find(class_='quotes-table-result__val')
【问题讨论】:
标签: python html beautifulsoup python-requests