简体   繁体   中英

How to Block images (img tags) from an iFrame?

Im searching for ideas to solve the following problem:

I'm loading an URL (any for that matter) into an iFrame, and then block (server side) all image tags, o object tags before sending the page to the client.

--
What I was thinking to do is: fetching the URL, and then manipulating the fetched content using a Java library (any recomendation on that matter?). And after that, send the modify content to que client.

Would that be the best approach to solve this problem? suggestions are wellcome :)

I suggest using HTML Parser It's java based and pretty simple to use. You can fetch all 'img' tags and replace if required.

jSoup is another option. I prefer HTML Parser though.

-- Sid

您应该尝试使用nekoHtml ,它可以让您像对待xml一样处理html。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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