Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
In order to extract only text from an HTML website in the most robust way without using regex or urlib or so, use the python library below:
https://github.com/aaronsw/html2text

Usage in terminal is:
Usage: html2text.py [(filename|url) [encoding]]

If you want it to use inside of your python code:
import html2text
print html2text.html2text("<p>Hello, world.</p>")

#python #html2text #github #html #text
Why some sites does not show in iFrame HTML tag?

The first reason you need to check is to make sure that you are not loading an HTTP website from within an HTTPS website, otherwise
you will get and error. You can see the error by using your browser Developer Tools -> Console.

If you are loading an HTTPS from inside of HTTPS and it is not loading, then take a look at the header X-Frame-Option in response header. If it exists it probably has avalue of either DENY or SAMEORIGIN.

DENY: No one can load the website in iframe. Even the same domain page wont be able to load.

SAMEORIGIN: only a page which is in same domain can load this website in iframe.

#html #iframe #X_Frame_Option