Speaking as a programmer, the solution to your problem is "don't be lazy."
Taking screenshots is easy but risks libeling others: It can include their logo, their product picture, their address and phone number, and they can argue that your criticism is costing them money, reputation and good will.
However, if you are writing something for professionals about web design then I presume you are expert and have experience doing it: So don't be lazy! If you have some rule to lay out, inspired by the site XYZ, just sit down at your keyboard and mock up a similar screen shot with that exact problem.
Note in your website and book that all screenshots are mock-ups inspired by real life; the names and products are changed to protect the innocent (more specifically, yourself). Don't include phone numbers or addresses or logos. If you feel those are important, make the logo some free clip art, make the company name your own in a similar (and free) font: "Amadeus Boats". If they are selling cars, you are selling boats, or trucks, or motorcycles: All free clip art. change the phone numbers to have a prefix of 555 or 000 (never used in real life), change the addresses to a fictional street name in your town with a fictional zip code (Here is a list of 40,934 actual zipcodes, but be aware they may change monthly, and also google your zip to see if it is being used in other fiction; e.g. Veronica Mars uses the fictional zip 90909; which you can see by googling just "90909").
Generalize the problem: If some guy spelt his own name wrong, spell your own name wrong: "Amdeus" instead of "Amadeus".
I presume your point is not to say "Go look at this crap for yourself!", but "Yes, this problem really happens, this is what it looks like and why it sucks, and here is how you could fix it."
Somebody recognizing their own layout in your publication (web or book) is not a problem unless they can prove it would be clear to strangers you are denigrating them. That should not be obvious if you focus on what the design problem is, and don't get involved in how stupid somebody must be to commit such an error.
It doesn't make your advice more compelling to be able to point at the actual moron that did something stupid. You are telling them these arereal problems on real websites. Presumably these problems occur often enough to make it worth learning to avoid them (in which case the error in question should exist on more than one website).
You don't have to worry about lawsuits if the work you display is your own creation.