I have a project using python. The framework used is beautifulsoup and rest.
First function: I have list keyword input like this:
Keyword: keyword 1, keyword 2, keyword 3, keyword 4, keyword 5,... keyword n.... (THIS IS INPUT)
Code will request one by one keyword and with one keyword it will download one image. After that it will remove exif, resize to 800 pixels and compress 50% quality. All images will save to the folder name: "image". (THIS IS OUTPUT)
Second function: I will use keywords and order to cover image HTML tag code. After that it will add an image HTML tag to HTML RAW and It will Add before heading 2. If quantity keyword >= quantity heading 2 it is not a problem. If quantity keyword < quantity heading 2 it will run module 1 again to find more images.
Input is HTML RAW like this: [login to view URL]
Output is HTML COVER like this:
[login to view URL]
Please try to code in simple. I want it to integrate into my project. I used only beautifulsoup, rest and string handling.