【发布时间】:2022-08-03 23:14:25
【问题描述】:
我正在尝试在页面底部获取此页面https://www.binance.com/es-LA/altcoins/new的新币信息表。但我对此有很多问题。
当我尝试查找 html 代码的某些部分(包含表格信息的部分)时,我得到无类型对象。我试着看div经过div但我总是在同一部分遇到同样的问题。
Buscador = requests.get(\'https://www.binance.com/es-LA/altcoins/new\', \'lxml\')
BuscadorSopeado = bs(Buscador.text, features = \'html.parser\')
BusquedaPrimero = BuscadorSopeado.find(name = \'div\', attrs = {\'class\': \"css-1t63o3e\"})
其中类型(BusquedaPrimero)= 无。
如果我看到 html 代码的前一部分,我会得到一条大线:
IN:
BusquedaPrimero = BuscadorSopeado.find(name = \'div\', attrs = {\'class\': \"css-pcu8qt\"})
OUT:
<div class=\"css-pcu8qt\"><style data-emotion-css=\"18rcfta\">.css-18rcfta{box-sizing:border-box;margin:0;min-width:0;overflow-wrap:break-word;font-size:24px;font-weight:600;line-height:32px;color:#1E2329;margin-bottom:64px;}@media screen and (min-width:767px){.css-18rcfta{font-size:32px;font-weight:600;line-height:40px;}}@media screen and (min-width:1023px){.css-18rcfta{font-size:40px;font-weight:600;line-height:48px;}}</style><h2 class=\"container__title css-18rcfta\" data-bn-type=\"text\">Principales criptoactivos por porcentaje de la capitalización total de mercado</h2><div class=\"sc-gtsrHT cVacoL cmc-btc-percentage-chart\" id=\"dominance-percentage\"><style data-emotion-css=\"1ig4gr6\">.css-1ig4gr6{box-sizing:border-box;margin:0;min-width:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:30px;height:30px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;margin-left:auto;margin-right:auto;margin-top:337px;margin-bottom:337px;}</style><div class=\"css-1ig4gr6\"><style data-emotion-css=\"2bc2yz animation-hqgv56\">
*AND MORE THINGS THAT I CUT.*
我是新的报废东西,所以如果解决方案很简单,我很抱歉。
标签: python html beautifulsoup spyder screen-scraping