alt text

Adding alt attributes to your img tags because you're too lazy to do so #CalHacks3.0(link is external)

What?

Basically a script that will take in some HTML, find all the img tags with no alt text, then use Microsoft Cognitive Services(link is external) to fill those in with a description of the image

Usage

mv keys.example.py keys.py

Replace ocp-apim-subscription-key in keys.py with your api key for Microsoft Cognitive Services(link is external)

python main.py siteUrl rootUrl outputFileName.html
  • siteUrl is the webpage HTML you want to grab
  • rootUrl is the base url for which image relative paths are used on the website (normally the homepage)
  • outFileName.html is the name of the file that the script will output with the filled in alt texts

Example


  python main.py http://debkbanerji.com/ http://debkbanerji.com/ output.html
  ```

Rating

0 out of 5 Stars 0 Review

5 Stars
 
0.00%
4 Stars
 
0.00%
3 Stars
 
0.00%
2 Stars
 
0.00%
1 Star
 
0.00%

About

  • There are no comments yet

Thank you! Review submitted.

Ok