This will be used for removing unwanted content within my automated selenium scripts!
My question: Is it possible on the client side to remove unwanted HTML code using JavaScript or some other technology?
Example scenario:
I'm not looking for someone to code me a solution to this problem, but instead push me in the right direction (a solution is a bonus!)
I will then update this question (if it lives) with the solution I have come up with and clean up the post !
NOTE: I understand Facebook already has a built in 'stop following' button to cover this. The scenario could be that if the content includes 'someone you might know!' then I want to remove this section of HTML from my browser !
Update: Since there's no code, I've added another example scenario!
HTML currently contains:
<div id="content"> <p> <em>prepares for -10 within seconds<em> </p> </div>
HTML then contains:
<div id="content"> </div>
答案 0 :(得分:1)
BrowserMob Proxy之类的代理怎么样...他们的着陆页读取,
它可以捕获Web应用程序的性能数据(通过HAR格式),如 以及操纵浏览器行为和流量,例如白名单 并将内容列入黑名单,模拟网络流量和延迟,以及 重写HTTP请求和响应。
您可以使用代理过滤掉您想要删除的元素。