Site for scanning images and attributes alt

We would like to run a check on our website, which returns a report with the following:

  • found image tag and visual representation of this image in the report
  • the alt attribute for this image (also indicate if the alt attribute was not found)

Is there a simple tool that does this? We are trying to verify the alt attributes and make sure that the alt attributes accurately describe the image they represent. This is why the visual presentation in the report is important.

+8
html accessibility section508
source share
6 answers

Try the Python Beautiful Soup package. It will analyze all your HTML for you in a really simple statement. Try this code:

website = urllib2.urlopen(url) websitehtml = website.read() soup = BeautifulSoup(websitehtml) matches = soup.findAll('img') for row in matches: print row['src'] print row['alt'] 

Here use row['src'] to set the src image and print alt next to it.

+3
source share

Accessify.com has many accessibility tools like bookmarklets (or "favelets"). One of them does what I think you are looking for. Look at this page for "Alt Attributes - Show All". Drag this link to your bookmarks, and then use it on the page you want to check.

In addition, the Web Accessibilty toolbar (available for Internet Explorer and Opera) has the "List Images" option in the "Images" section, which will do the same - the list of images and the code associated with each.

As for checking entire sites, accessible accessibility checks are available, which should have a feature like aDesigner .

+1
source share

http://sourceforge.net/projects/simplehtmldom/

I would use something like that, very good and easy to use!

0
source share

This SO answer contains some pointers to using Selenium to check your site for images with alt text.

0
source share

It sounds like you want something that works the way it does for example. asked Jeremy. Ie, just some long list with each image and its alt attribute. The problem is that this will not give you enough context to provide the useful alt attribute, because the alt attribute should not (in general) β€œaccurately describe [...] the image that they represent,” but rather describes that the image is intended for views on the current page. It is difficult to give a brief description of how to write useful alt texts. The Wikipedia article on alt attributes by itself sucks the current state in it, but the links are useful. There are, of course, many other SO questions related to this.

Maybe some kind of pre-written tool that does what you asked for, if, for example, all pages are reachable from the start page, you could just scan the entire website and generate a list. But if it is possible only on some pages, for example. the search may need some kind of tool to work with the site.

In any case, let's say that we have such a tool. Even then, its use is quite limited. Even if you can get a list of all the images on a website using the alt text associated with it, you still have to visit all the pages, one page at a time and, possibly, use some web developer extension in some browser (there is such tools in other answers, I think), which displays all the texts on the page; and then correct the alt text after you know which image is actually used on the corresponding page.

So, this tool that you request will be useful only for searching pages with possible improper use of the alt attribute (that is, any page with an image on it). (But depending on the site in question, even this may be useful, of course.) You still need to open a web page that actually uses the image (or, if you want, read the HTML code for the page) to find out which one will be correct / best text.

So, at best, you get a list of pages with images that you should check. But it will still miss some important cases, for example. cases when the CSS background-image property is used to display a button (instead of an img image), which should have alt text.

0
source share

IziSEO will generate a complete list of images, as well as the attributes ALT, WIDTH, HEIGHT, as well as the line number in the HTML code. You can then export this list to a PDF or CSV file.

0
source share

Source: https://habr.com/ru/post/650762/


All Articles