简体   繁体   English

如何使用硒从隐藏在html中的浏览器中获取文本?

[英]How to get text from browser that is hidden in the html using selenium?

How to get text that one can visibly see when visiting the page, but is no where to be found in the html code? 如何获取访问页面时可以看到的文本,但是在html代码中找不到?

Often times, I can just use driver.pagesource to get the text from the page, but I have a case where I can visibly see the text, but it's not anywhere in the html file when I download it. 通常,我可以只使用driver.pagesource从页面中获取文本,但是在某些情况下,我可以清晰地看到文本,但是在下载时它不在html文件的任何位置。

Maybe code is present at the iframe , and you need special syntax for handling objects inside iframe. 也许代码存在于iframe上 ,并且您需要特殊的语法来处理iframe中的对象。

Also, you can use JavaScript for make element visible. 另外,您可以使用JavaScript使元素可见。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM