Menu

165 HTML errors across our 76 pages, and deleting one attribute removes 152 of them
📰

165 HTML errors across our 76 pages, and deleting one attribute removes 152 of them

DEV Community: nextjs·Daniel Pertu·4 days ago
#YhcuvSRV
#devtonextjs#devto#dev#three#label
Reading 0:00
15s threshold

I have never once run my own site through a validator. Forty-one days of pages, 76 of them, and I had checked colour contrast, spelling, structured data and link graphs without ever asking whether the markup underneath was legal.

So I fed all 76 to the Nu checker and counted. The loop is about ten lines:

html = urllib . request . urlopen ( url , timeout = 60 ) . read ( ) req = urllib . request . Request ( "https://validator.w3.org/nu/?out=json" , data = html , headers = { "Content-Type" : "text/html; charset=utf-8" } , ) messages = json . loads ( urllib . request . urlopen ( req , timeout = 120 ) . read ( ) ) [ "messages" ]

Enter fullscreen mode

Exit fullscreen mode

One request a second so I am not rude to a free public service.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.