admin管理员组文章数量:1435510
I've recently asked about a way to call a js function in python. People gave me advice such as using js2py, or pyv8, but the problem is that it does not allow me to use the following js mand:
document.getElementById("example");
So my question is: Is there a way to call js from a python function and that allows you to use the js mand above?
Thanks in advance!
I've recently asked about a way to call a js function in python. People gave me advice such as using js2py, or pyv8, but the problem is that it does not allow me to use the following js mand:
document.getElementById("example");
So my question is: Is there a way to call js from a python function and that allows you to use the js mand above?
Thanks in advance!
Share Improve this question edited Aug 23, 2016 at 14:03 Setily 8221 gold badge9 silver badges21 bronze badges asked Aug 23, 2016 at 13:59 soukisouki 1,3854 gold badges25 silver badges43 bronze badges1 Answer
Reset to default 3If calling js function in python means: How can I select node with specific id?, then you can use BeautifulSoup for it:
from bs4 import BeautifulSoup
html_doc = "<html><head><title></title></head><body><div id='example'></body></html>"
soup = BeautifulSoup(html_doc, 'html.parser')
soup.find(id="example")
本文标签: javascriptCall js function in python to use documentgetElementByIdStack Overflow
版权声明:本文标题:javascript - Call js function in python to use document.getElementById - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745652118a2668491.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论