英文:
Is there a way to edit HTML in python selenium?
问题
以下是您要翻译的内容:
"我想要修改HTML代码,类似于
- 爬取特定网站并修改特定的HTML代码
我想要构建自己的自动化程序,但在寻找相关信息时找不到任何相关内容。"
英文:
as an example
<div>
<h5>title1</h5>
<h3>subtitle1</h3>
</div>
at
<div>
<h3>title2</h3>
<h1>subtitle2</h1>
</div>
I want to modify HTML code like
- Crawl certain websites and modify certain HTML code
I wanted to build my own automation program, but I couldn't find anything related to it while looking for it.
答案1
得分: 0
一直以来我都使用JS通过Python的driver.execute_script
命令来修改一些HTML元素。<br>
在搜索时我还注意到现在有更多的人倾向于使用BeautifulSoup来完成这些任务。<br>
英文:
I've always used JS to modify some HTML elements from python with the driver.execute_script
command. <br>
While googling I've also noticed that nowadays more people tend to use BeautifulSoup for such tasks. <br>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论