尝试从网站获取值,但它给出 0.00 而不是不为零的实际值
这是我尝试用 python selenium 获取的值:
<div class="price">$<div style="display: inline-block;">24.42</div></div>
这是我的代码:
Value = browser.find_elements(By.CLASS_NAME, ('price'))
print(Value[1].text)
这是我在 Atom 控制台中的输出:
$
0.00
重要的是要知道: 我尝试每分钟左右获取该数字的更改。 “价格”类在网站上显示两次,这就是我选择第二个元素(又名 [1])的原因。
我的问题: 如何正确编码以获得 24.42 的值? (“Value”的类型是div。) 如果我得到了这个值,我可以使用相同的代码来获取另一个值来比较它们。
感谢您的回答:)
here is the value i try to grab with python selenium:
<div class="price">lt;div style="display: inline-block;">24.42</div></div>
Here is my code:
Value = browser.find_elements(By.CLASS_NAME, ('price'))
print(Value[1].text)
Here is my output in Atom console:
$
0.00
Important to know: That number i try to get changes every minute or so.
The class "price" shows two times on the website, thats why I choose the second element aka [1].
My question:
How to code this correctly, to get the value of 24.42? (The type of "Value" is div.)
If I get the value, I can use the same code to get another vaule to compare them.
Thanks for your answers :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论