我想使用Selenium和Python在网页中找到一个元素,如何获得输入值?
因此,这是我正在与之合作的网站的细分市场。特别是我想从中获得价值。我可以使用best_offer = driver.find_element_by_class_name('showbestoffer')
在硒中访问跨度类,我可以在标签内获取值吗?
<div class="ebayBestOfferAccepted" id="363858864519-bestOffer-simple"><div class="bestOfferSoldPrice" style="display: flex; align-items: center; justify-content: center;"><span class="bestOfferData"><b>Best Offer Accepted Price: </b></span><span class="bestOfferLink"><span class="showBestOffer"><input type="submit" value="15.00 USD"></span></span></div></div>
So here's the segment of the website that I'm working with. Specifically I wanna obtain the value from . I can access the span class using best_offer = driver.find_element_by_class_name('showBestOffer')
in Selenium, is there a way I can fetch the value inside the tag?
<div class="ebayBestOfferAccepted" id="363858864519-bestOffer-simple"><div class="bestOfferSoldPrice" style="display: flex; align-items: center; justify-content: center;"><span class="bestOfferData"><b>Best Offer Accepted Price: </b></span><span class="bestOfferLink"><span class="showBestOffer"><input type="submit" value="15.00 USD"></span></span></div></div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以尝试此解决方案
You can try this solution
使用XPath
Using xpath