Skip to content

Instantly share code, notes, and snippets.

View leonardopinho's full-sized avatar

Leonardo Pinho leonardopinho

  • Senior Systems Analyst,
  • Salvador / Bahia
View GitHub Profile
from bs4 import BeautifulSoup
def clean_html(html_text):
"""
Remove trash of raw text
:param html_text:
:return:
"""
text = BeautifulSoup(html_text, "lxml").text
import wget
from PIL import Image
def download_image(filename, url, path='', resize=False, width=600):
"""
backup of the images of server
:param filename:
:param url:
:param path:
:param resize: