【Python爬虫】将某网页中表格里的十六进制颜色值转换成十进制,再生成新表格

【需求】

在 https://www.cnblogs.com/heyang78/p/5712076.html 上有360种颜色及代码,但很遗憾没有十进制的RGB值,使用时需要自己转换一下,此过程依赖网络或计算器,颇为不便。因此,拟设计一爬虫将原有表格内容取出,在其原有颜色代码下添加十进制的RGB值。

具体意图如下图:

【关键点】

取网页内容使用requests,解析网页使用BeautifulSoup,先遍历所有的tr,再取tr下的td,如果其有bgcolor属性,那就是要找的目标。

使用函数int(txt,16)将两位颜色值转换为十进制的颜色值即可。

比如颜色值是bgcolor="#820041",那么取其R值的方法是bgcolor[1:3],取十进制R值的方法是r = int(bgcolor[1:3],16)

其它的文本组合有html知识即可,无须赘述。

【代码】

#encoding=utf-8

# 内置网络访问包
import requests

# 内置的urllib.request模块
import urllib.request

# 解析html的BeautifulSoup包,安装方法是pip install BeautifulSoup4
from bs4 import BeautifulSoup

# 引入正则表达式包
import re

# 把请求伪装成浏览器Mozilla
user_agent='Mozilla/4.0 (compatible;MEIE 5.5;windows NT)'
headers={'User-Agent':user_agent}

# 要访问的页码地址
url="https://www.cnblogs.com/heyang78/p/5712076.html"

# 发起请求获取其html内容
html=requests.get(url,headers=headers)

# 使用BeautifulSoup解析html文本
soup= BeautifulSoup(html.text,'html.parser');

# 存储生成的新文本
content=""

# 遍历网页中所有的tr
for tr in soup.find_all('tr'):
    #一行tr开始
    content=content+"<tr>"

    # 遍历tr中的td
    for td in tr.find_all('td'):
        # 取td的bgcolor属性
        bgcolor=td.get("bgcolor")
        if bgcolor!=None:
            r = int(bgcolor[1:3],16) # red 将16进制的R值转十进制
            g = int(bgcolor[3:5],16) # green 将16进制的G值转十进制
            b = int(bgcolor[5:7],16) # blue 将16进制的B值转十进制
            #print("bgcolor="+bgcolor+" r="+str(r)+" g="+str(g)+" b="+str(b));

            #累加成新的三列td
            content=content+"<td bgcolor=\""+bgcolor+"\" width=\"60\">&nbsp;</td>"
            content=content+"<td width=\"50\">"+bgcolor+"<br/>("+str(r)+","+str(g)+","+str(b)+")</td>"
    
    #一行tr结束
    content=content+"</tr>"

print(content)        

【最终打印出来的内容】

<tr><td bgcolor="#000000" width="60">&nbsp;</td><td width="50">#000000<br/>(0,0,0)</td><td bgcolor="#2f0000" width="60">&nbsp;</td><td width="50">#2f0000<br/>(47,0,0)</td><td bgcolor="#600030" width="60">&nbsp;</td><td width="50">#600030<br/>(96,0,48)</td><td bgcolor="#460046" width="60">&nbsp;</td><td width="50">#460046<br/>(70,0,70)</td><td bgcolor="#28004d" width="60">&nbsp;</td><td width="50">#28004d<br/>(40,0,77)</td></tr><tr><td bgcolor="#272727" width="60">&nbsp;</td><td width="50">#272727<br/>(39,39,39)</td><td bgcolor="#4d0000" width="60">&nbsp;</td><td width="50">#4d0000<br/>(77,0,0)</td><td bgcolor="#820041" width="60">&nbsp;</td><td width="50">#820041<br/>(130,0,65)</td><td bgcolor="#5e005e" width="60">&nbsp;</td><td width="50">#5e005e<br/>(94,0,94)</td><td bgcolor="#3a006f" width="60">&nbsp;</td><td width="50">#3a006f<br/>(58,0,111)</td></tr><tr><td bgcolor="#3c3c3c" width="60">&nbsp;</td><td width="50">#3c3c3c<br/>(60,60,60)</td><td bgcolor="#600000" width="60">&nbsp;</td><td width="50">#600000<br/>(96,0,0)</td><td bgcolor="#9f0050" width="60">&nbsp;</td><td width="50">#9f0050<br/>(159,0,80)</td><td bgcolor="#750075" width="60">&nbsp;</td><td width="50">#750075<br/>(117,0,117)</td><td bgcolor="#4b0091" width="60">&nbsp;</td><td width="50">#4b0091<br/>(75,0,145)</td></tr><tr><td bgcolor="#4f4f4f" width="60">&nbsp;</td><td width="50">#4f4f4f<br/>(79,79,79)</td><td bgcolor="#750000" width="60">&nbsp;</td><td width="50">#750000<br/>(117,0,0)</td><td bgcolor="#bf0060" width="60">&nbsp;</td><td width="50">#bf0060<br/>(191,0,96)</td><td bgcolor="#930093" width="60">&nbsp;</td><td width="50">#930093<br/>(147,0,147)</td><td bgcolor="#5b00ae" width="60">&nbsp;</td><td width="50">#5b00ae<br/>(91,0,174)</td></tr><tr><td bgcolor="#5b5b5b" width="60">&nbsp;</td><td width="50">#5b5b5b<br/>(91,91,91)</td><td bgcolor="#930000" width="60">&nbsp;</td><td width="50">#930000<br/>(147,0,0)</td><td bgcolor="#d9006c" width="60">&nbsp;</td><td width="50">#d9006c<br/>(217,0,108)</td><td bgcolor="#ae00ae" width="60">&nbsp;</td><td width="50">#ae00ae<br/>(174,0,174)</td><td bgcolor="#6f00d2" width="60">&nbsp;</td><td width="50">#6f00d2<br/>(111,0,210)</td></tr><tr><td bgcolor="#6c6c6c" width="60">&nbsp;</td><td width="50">#6c6c6c<br/>(108,108,108)</td><td bgcolor="#ae0000" width="60">&nbsp;</td><td width="50">#ae0000<br/>(174,0,0)</td><td bgcolor="#f00078" width="60">&nbsp;</td><td width="50">#f00078<br/>(240,0,120)</td><td bgcolor="#d200d2" width="60">&nbsp;</td><td width="50">#d200d2<br/>(210,0,210)</td><td bgcolor="#8600ff" width="60">&nbsp;</td><td width="50">#8600ff<br/>(134,0,255)</td></tr><tr><td bgcolor="#7b7b7b" width="60">&nbsp;</td><td width="50">#7b7b7b<br/>(123,123,123)</td><td bgcolor="#ce0000" width="60">&nbsp;</td><td width="50">#ce0000<br/>(206,0,0)</td><td bgcolor="#ff0080" width="60">&nbsp;</td><td width="50">#ff0080<br/>(255,0,128)</td><td bgcolor="#e800e8" width="60">&nbsp;</td><td width="50">#e800e8<br/>(232,0,232)</td><td bgcolor="#921aff" width="60">&nbsp;</td><td width="50">#921aff<br/>(146,26,255)</td></tr><tr><td bgcolor="#8e8e8e" width="60">&nbsp;</td><td width="50">#8e8e8e<br/>(142,142,142)</td><td bgcolor="#ea0000" width="60">&nbsp;</td><td width="50">#ea0000<br/>(234,0,0)</td><td bgcolor="#ff359a" width="60">&nbsp;</td><td width="50">#ff359a<br/>(255,53,154)</td><td bgcolor="#ff00ff" width="60">&nbsp;</td><td width="50">#ff00ff<br/>(255,0,255)</td><td bgcolor="#9f35ff" width="60">&nbsp;</td><td width="50">#9f35ff<br/>(159,53,255)</td></tr><tr><td bgcolor="#9d9d9d" width="60">&nbsp;</td><td width="50">#9d9d9d<br/>(157,157,157)</td><td bgcolor="#ff0000" width="60">&nbsp;</td><td width="50">#ff0000<br/>(255,0,0)</td><td bgcolor="#ff60af" width="60">&nbsp;</td><td width="50">#ff60af<br/>(255,96,175)</td><td bgcolor="#ff44ff" width="60">&nbsp;</td><td width="50">#ff44ff<br/>(255,68,255)</td><td bgcolor="#b15bff" width="60">&nbsp;</td><td width="50">#b15bff<br/>(177,91,255)</td></tr><tr><td bgcolor="#adadad" width="60">&nbsp;</td><td width="50">#adadad<br/>(173,173,173)</td><td bgcolor="#ff2d2d" width="60">&nbsp;</td><td width="50">#ff2d2d<br/>(255,45,45)</td><td bgcolor="#ff79bc" width="60">&nbsp;</td><td width="50">#ff79bc<br/>(255,121,188)</td><td bgcolor="#ff77ff" width="60">&nbsp;</td><td width="50">#ff77ff<br/>(255,119,255)</td><td bgcolor="#be77ff" width="60">&nbsp;</td><td width="50">#be77ff<br/>(190,119,255)</td></tr><tr><td bgcolor="#bebebe" width="60">&nbsp;</td><td width="50">#bebebe<br/>(190,190,190)</td><td bgcolor="#ff5151" width="60">&nbsp;</td><td width="50">#ff5151<br/>(255,81,81)</td><td bgcolor="#ff95ca" width="60">&nbsp;</td><td width="50">#ff95ca<br/>(255,149,202)</td><td bgcolor="#ff8eff" width="60">&nbsp;</td><td width="50">#ff8eff<br/>(255,142,255)</td><td bgcolor="#ca8eff" width="60">&nbsp;</td><td width="50">#ca8eff<br/>(202,142,255)</td></tr><tr><td bgcolor="#d0d0d0" width="60">&nbsp;</td><td width="50">#d0d0d0<br/>(208,208,208)</td><td bgcolor="#ff7575" width="60">&nbsp;</td><td width="50">#ff7575<br/>(255,117,117)</td><td bgcolor="#ffaad5" width="60">&nbsp;</td><td width="50">#ffaad5<br/>(255,170,213)</td><td bgcolor="#ffa6ff" width="60">&nbsp;</td><td width="50">#ffa6ff<br/>(255,166,255)</td><td bgcolor="#d3a4ff" width="60">&nbsp;</td><td width="50">#d3a4ff<br/>(211,164,255)</td></tr><tr><td bgcolor="#e0e0e0" width="60">&nbsp;</td><td width="50">#e0e0e0<br/>(224,224,224)</td><td bgcolor="#ff9797" width="60">&nbsp;</td><td width="50">#ff9797<br/>(255,151,151)</td><td bgcolor="#ffc1e0" width="60">&nbsp;</td><td width="50">#ffc1e0<br/>(255,193,224)</td><td bgcolor="#ffbfff" width="60">&nbsp;</td><td width="50">#ffbfff<br/>(255,191,255)</td><td bgcolor="#dcb5ff" width="60">&nbsp;</td><td width="50">#dcb5ff<br/>(220,181,255)</td></tr><tr><td bgcolor="#f0f0f0" width="60">&nbsp;</td><td width="50">#f0f0f0<br/>(240,240,240)</td><td bgcolor="#ffb5b5" width="60">&nbsp;</td><td width="50">#ffb5b5<br/>(255,181,181)</td><td bgcolor="#ffd9ec" width="60">&nbsp;</td><td width="50">#ffd9ec<br/>(255,217,236)</td><td bgcolor="#ffd0ff" width="60">&nbsp;</td><td width="50">#ffd0ff<br/>(255,208,255)</td><td bgcolor="#e6caff" width="60">&nbsp;</td><td width="50">#e6caff<br/>(230,202,255)</td></tr><tr><td bgcolor="#fcfcfc" width="60">&nbsp;</td><td width="50">#fcfcfc<br/>(252,252,252)</td><td bgcolor="#ffd2d2" width="60">&nbsp;</td><td width="50">#ffd2d2<br/>(255,210,210)</td><td bgcolor="#ffecf5" width="60">&nbsp;</td><td width="50">#ffecf5<br/>(255,236,245)</td><td bgcolor="#ffe6ff" width="60">&nbsp;</td><td width="50">#ffe6ff<br/>(255,230,255)</td><td bgcolor="#f1e1ff" width="60">&nbsp;</td><td width="50">#f1e1ff<br/>(241,225,255)</td></tr><tr><td bgcolor="#ffffff" width="60">&nbsp;</td><td width="50">#ffffff<br/>(255,255,255)</td><td bgcolor="#ffecec" width="60">&nbsp;</td><td width="50">#ffecec<br/>(255,236,236)</td><td bgcolor="#fff7fb" width="60">&nbsp;</td><td width="50">#fff7fb<br/>(255,247,251)</td><td bgcolor="#fff7ff" width="60">&nbsp;</td><td width="50">#fff7ff<br/>(255,247,255)</td><td bgcolor="#faf4ff" width="60">&nbsp;</td><td width="50">#faf4ff<br/>(250,244,255)</td></tr><tr><td bgcolor="#000079" width="60">&nbsp;</td><td width="50">#000079<br/>(0,0,121)</td><td bgcolor="#000079" width="60">&nbsp;</td><td width="50">#000079<br/>(0,0,121)</td><td bgcolor="#003e3e" width="60">&nbsp;</td><td width="50">#003e3e<br/>(0,62,62)</td><td bgcolor="#006030" width="60">&nbsp;</td><td width="50">#006030<br/>(0,96,48)</td><td bgcolor="#006000" width="60">&nbsp;</td><td width="50">#006000<br/>(0,96,0)</td></tr><tr><td bgcolor="#000093" width="60">&nbsp;</td><td width="50">#000093<br/>(0,0,147)</td><td bgcolor="#003d79" width="60">&nbsp;</td><td width="50">#003d79<br/>(0,61,121)</td><td bgcolor="#005757" width="60">&nbsp;</td><td width="50">#005757<br/>(0,87,87)</td><td bgcolor="#01814a" width="60">&nbsp;</td><td width="50">#01814a<br/>(1,129,74)</td><td bgcolor="#007500" width="60">&nbsp;</td><td width="50">#007500<br/>(0,117,0)</td></tr><tr><td bgcolor="#0000c6" width="60">&nbsp;</td><td width="50">#0000c6<br/>(0,0,198)</td><td bgcolor="#004b97" width="60">&nbsp;</td><td width="50">#004b97<br/>(0,75,151)</td><td bgcolor="#007979" width="60">&nbsp;</td><td width="50">#007979<br/>(0,121,121)</td><td bgcolor="#019858" width="60">&nbsp;</td><td width="50">#019858<br/>(1,152,88)</td><td bgcolor="#009100" width="60">&nbsp;</td><td width="50">#009100<br/>(0,145,0)</td></tr><tr><td bgcolor="#0000c6" width="60">&nbsp;</td><td width="50">#0000c6<br/>(0,0,198)</td><td bgcolor="#005ab5" width="60">&nbsp;</td><td width="50">#005ab5<br/>(0,90,181)</td><td bgcolor="#009393" width="60">&nbsp;</td><td width="50">#009393<br/>(0,147,147)</td><td bgcolor="#01b468" width="60">&nbsp;</td><td width="50">#01b468<br/>(1,180,104)</td><td bgcolor="#00a600" width="60">&nbsp;</td><td width="50">#00a600<br/>(0,166,0)</td></tr><tr><td bgcolor="#0000e3" width="60">&nbsp;</td><td width="50">#0000e3<br/>(0,0,227)</td><td bgcolor="#0066cc" width="60">&nbsp;</td><td width="50">#0066cc<br/>(0,102,204)</td><td bgcolor="#00aeae" width="60">&nbsp;</td><td width="50">#00aeae<br/>(0,174,174)</td><td bgcolor="#02c874" width="60">&nbsp;</td><td width="50">#02c874<br/>(2,200,116)</td><td bgcolor="#00bb00" width="60">&nbsp;</td><td width="50">#00bb00<br/>(0,187,0)</td></tr><tr><td bgcolor="#2828ff" width="60">&nbsp;</td><td width="50">#2828ff<br/>(40,40,255)</td><td bgcolor="#0072e3" width="60">&nbsp;</td><td width="50">#0072e3<br/>(0,114,227)</td><td bgcolor="#00caca" width="60">&nbsp;</td><td width="50">#00caca<br/>(0,202,202)</td><td bgcolor="#02df82" width="60">&nbsp;</td><td width="50">#02df82<br/>(2,223,130)</td><td bgcolor="#00db00" width="60">&nbsp;</td><td width="50">#00db00<br/>(0,219,0)</td></tr><tr><td bgcolor="#4a4aff" width="60">&nbsp;</td><td width="50">#4a4aff<br/>(74,74,255)</td><td bgcolor="#0080ff" width="60">&nbsp;</td><td width="50">#0080ff<br/>(0,128,255)</td><td bgcolor="#00e3e3" width="60">&nbsp;</td><td width="50">#00e3e3<br/>(0,227,227)</td><td bgcolor="#02f78e" width="60">&nbsp;</td><td width="50">#02f78e<br/>(2,247,142)</td><td bgcolor="#00ec00" width="60">&nbsp;</td><td width="50">#00ec00<br/>(0,236,0)</td></tr><tr><td bgcolor="#6a6aff" width="60">&nbsp;</td><td width="50">#6a6aff<br/>(106,106,255)</td><td bgcolor="#2894ff" width="60">&nbsp;</td><td width="50">#2894ff<br/>(40,148,255)</td><td bgcolor="#00ffff" width="60">&nbsp;</td><td width="50">#00ffff<br/>(0,255,255)</td><td bgcolor="#1afd9c" width="60">&nbsp;</td><td width="50">#1afd9c<br/>(26,253,156)</td><td bgcolor="#28ff28" width="60">&nbsp;</td><td width="50">#28ff28<br/>(40,255,40)</td></tr><tr><td bgcolor="#7d7dff" width="60">&nbsp;</td><td width="50">#7d7dff<br/>(125,125,255)</td><td bgcolor="#46a3ff" width="60">&nbsp;</td><td width="50">#46a3ff<br/>(70,163,255)</td><td bgcolor="#4dffff" width="60">&nbsp;</td><td width="50">#4dffff<br/>(77,255,255)</td><td bgcolor="#4efeb3" width="60">&nbsp;</td><td width="50">#4efeb3<br/>(78,254,179)</td><td bgcolor="#53ff53" width="60">&nbsp;</td><td width="50">#53ff53<br/>(83,255,83)</td></tr><tr><td bgcolor="#9393ff" width="60">&nbsp;</td><td width="50">#9393ff<br/>(147,147,255)</td><td bgcolor="#66b3ff" width="60">&nbsp;</td><td width="50">#66b3ff<br/>(102,179,255)</td><td bgcolor="#80ffff" width="60">&nbsp;</td><td width="50">#80ffff<br/>(128,255,255)</td><td bgcolor="#7afec6" width="60">&nbsp;</td><td width="50">#7afec6<br/>(122,254,198)</td><td bgcolor="#79ff79" width="60">&nbsp;</td><td width="50">#79ff79<br/>(121,255,121)</td></tr><tr><td bgcolor="#aaaaff" width="60">&nbsp;</td><td width="50">#aaaaff<br/>(170,170,255)</td><td bgcolor="#84c1ff" width="60">&nbsp;</td><td width="50">#84c1ff<br/>(132,193,255)</td><td bgcolor="#a6ffff" width="60">&nbsp;</td><td width="50">#a6ffff<br/>(166,255,255)</td><td bgcolor="#96fed1" width="60">&nbsp;</td><td width="50">#96fed1<br/>(150,254,209)</td><td bgcolor="#93ff93" width="60">&nbsp;</td><td width="50">#93ff93<br/>(147,255,147)</td></tr><tr><td bgcolor="#b9b9ff" width="60">&nbsp;</td><td width="50">#b9b9ff<br/>(185,185,255)</td><td bgcolor="#97cbff" width="60">&nbsp;</td><td width="50">#97cbff<br/>(151,203,255)</td><td bgcolor="#bbffff" width="60">&nbsp;</td><td width="50">#bbffff<br/>(187,255,255)</td><td bgcolor="#adfedc" width="60">&nbsp;</td><td width="50">#adfedc<br/>(173,254,220)</td><td bgcolor="#a6ffa6" width="60">&nbsp;</td><td width="50">#a6ffa6<br/>(166,255,166)</td></tr><tr><td bgcolor="#ceceff" width="60">&nbsp;</td><td width="50">#ceceff<br/>(206,206,255)</td><td bgcolor="#acd6ff" width="60">&nbsp;</td><td width="50">#acd6ff<br/>(172,214,255)</td><td bgcolor="#caffff" width="60">&nbsp;</td><td width="50">#caffff<br/>(202,255,255)</td><td bgcolor="#c1ffe4" width="60">&nbsp;</td><td width="50">#c1ffe4<br/>(193,255,228)</td><td bgcolor="#bbffbb" width="60">&nbsp;</td><td width="50">#bbffbb<br/>(187,255,187)</td></tr><tr><td bgcolor="#ddddff" width="60">&nbsp;</td><td width="50">#ddddff<br/>(221,221,255)</td><td bgcolor="#c4e1ff" width="60">&nbsp;</td><td width="50">#c4e1ff<br/>(196,225,255)</td><td bgcolor="#d9ffff" width="60">&nbsp;</td><td width="50">#d9ffff<br/>(217,255,255)</td><td bgcolor="#d7ffee" width="60">&nbsp;</td><td width="50">#d7ffee<br/>(215,255,238)</td><td bgcolor="#ceffce" width="60">&nbsp;</td><td width="50">#ceffce<br/>(206,255,206)</td></tr><tr><td bgcolor="#ececff" width="60">&nbsp;</td><td width="50">#ececff<br/>(236,236,255)</td><td bgcolor="#d2e9ff" width="60">&nbsp;</td><td width="50">#d2e9ff<br/>(210,233,255)</td><td bgcolor="#ecffff" width="60">&nbsp;</td><td width="50">#ecffff<br/>(236,255,255)</td><td bgcolor="#e8fff5" width="60">&nbsp;</td><td width="50">#e8fff5<br/>(232,255,245)</td><td bgcolor="#dfffdf" width="60">&nbsp;</td><td width="50">#dfffdf<br/>(223,255,223)</td></tr><tr><td bgcolor="#fbfbff" width="60">&nbsp;</td><td width="50">#fbfbff<br/>(251,251,255)</td><td bgcolor="#ecf5ff" width="60">&nbsp;</td><td width="50">#ecf5ff<br/>(236,245,255)</td><td bgcolor="#fdffff" width="60">&nbsp;</td><td width="50">#fdffff<br/>(253,255,255)</td><td bgcolor="#fbfffd" width="60">&nbsp;</td><td width="50">#fbfffd<br/>(251,255,253)</td><td bgcolor="#f0fff0" width="60">&nbsp;</td><td width="50">#f0fff0<br/>(240,255,240)</td></tr><tr><td bgcolor="#467500" width="60">&nbsp;</td><td width="50">#467500<br/>(70,117,0)</td><td bgcolor="#424200" width="60">&nbsp;</td><td width="50">#424200<br/>(66,66,0)</td><td bgcolor="#5b4b00" width="60">&nbsp;</td><td width="50">#5b4b00<br/>(91,75,0)</td><td bgcolor="#844200" width="60">&nbsp;</td><td width="50">#844200<br/>(132,66,0)</td><td bgcolor="#642100" width="60">&nbsp;</td><td width="50">#642100<br/>(100,33,0)</td></tr><tr><td bgcolor="#548c00" width="60">&nbsp;</td><td width="50">#548c00<br/>(84,140,0)</td><td bgcolor="#5b5b00" width="60">&nbsp;</td><td width="50">#5b5b00<br/>(91,91,0)</td><td bgcolor="#796400" width="60">&nbsp;</td><td width="50">#796400<br/>(121,100,0)</td><td bgcolor="#9f5000" width="60">&nbsp;</td><td width="50">#9f5000<br/>(159,80,0)</td><td bgcolor="#842b00" width="60">&nbsp;</td><td width="50">#842b00<br/>(132,43,0)</td></tr><tr><td bgcolor="#64a600" width="60">&nbsp;</td><td width="50">#64a600<br/>(100,166,0)</td><td bgcolor="#737300" width="60">&nbsp;</td><td width="50">#737300<br/>(115,115,0)</td><td bgcolor="#977c00" width="60">&nbsp;</td><td width="50">#977c00<br/>(151,124,0)</td><td bgcolor="#bb5e00" width="60">&nbsp;</td><td width="50">#bb5e00<br/>(187,94,0)</td><td bgcolor="#a23400" width="60">&nbsp;</td><td width="50">#a23400<br/>(162,52,0)</td></tr><tr><td bgcolor="#73bf00" width="60">&nbsp;</td><td width="50">#73bf00<br/>(115,191,0)</td><td bgcolor="#8c8c00" width="60">&nbsp;</td><td width="50">#8c8c00<br/>(140,140,0)</td><td bgcolor="#ae8f00" width="60">&nbsp;</td><td width="50">#ae8f00<br/>(174,143,0)</td><td bgcolor="#d26900" width="60">&nbsp;</td><td width="50">#d26900<br/>(210,105,0)</td><td bgcolor="#bb3d00" width="60">&nbsp;</td><td width="50">#bb3d00<br/>(187,61,0)</td></tr><tr><td bgcolor="#82d900" width="60">&nbsp;</td><td width="50">#82d900<br/>(130,217,0)</td><td bgcolor="#a6a600" width="60">&nbsp;</td><td width="50">#a6a600<br/>(166,166,0)</td><td bgcolor="#c6a300" width="60">&nbsp;</td><td width="50">#c6a300<br/>(198,163,0)</td><td bgcolor="#ea7500" width="60">&nbsp;</td><td width="50">#ea7500<br/>(234,117,0)</td><td bgcolor="#d94600" width="60">&nbsp;</td><td width="50">#d94600<br/>(217,70,0)</td></tr><tr><td bgcolor="#8cea00" width="60">&nbsp;</td><td width="50">#8cea00<br/>(140,234,0)</td><td bgcolor="#c4c400" width="60">&nbsp;</td><td width="50">#c4c400<br/>(196,196,0)</td><td bgcolor="#d9b300" width="60">&nbsp;</td><td width="50">#d9b300<br/>(217,179,0)</td><td bgcolor="#ff8000" width="60">&nbsp;</td><td width="50">#ff8000<br/>(255,128,0)</td><td bgcolor="#f75000" width="60">&nbsp;</td><td width="50">#f75000<br/>(247,80,0)</td></tr><tr><td bgcolor="#9aff02" width="60">&nbsp;</td><td width="50">#9aff02<br/>(154,255,2)</td><td bgcolor="#e1e100" width="60">&nbsp;</td><td width="50">#e1e100<br/>(225,225,0)</td><td bgcolor="#eac100" width="60">&nbsp;</td><td width="50">#eac100<br/>(234,193,0)</td><td bgcolor="#ff9224" width="60">&nbsp;</td><td width="50">#ff9224<br/>(255,146,36)</td><td bgcolor="#ff5809" width="60">&nbsp;</td><td width="50">#ff5809<br/>(255,88,9)</td></tr><tr><td bgcolor="#a8ff24" width="60">&nbsp;</td><td width="50">#a8ff24<br/>(168,255,36)</td><td bgcolor="#f9f900" width="60">&nbsp;</td><td width="50">#f9f900<br/>(249,249,0)</td><td bgcolor="#ffd306" width="60">&nbsp;</td><td width="50">#ffd306<br/>(255,211,6)</td><td bgcolor="#ffa042" width="60">&nbsp;</td><td width="50">#ffa042<br/>(255,160,66)</td><td bgcolor="#ff8040" width="60">&nbsp;</td><td width="50">#ff8040<br/>(255,128,64)</td></tr><tr><td bgcolor="#b7ff4a" width="60">&nbsp;</td><td width="50">#b7ff4a<br/>(183,255,74)</td><td bgcolor="#ffff37" width="60">&nbsp;</td><td width="50">#ffff37<br/>(255,255,55)</td><td bgcolor="#ffdc35" width="60">&nbsp;</td><td width="50">#ffdc35<br/>(255,220,53)</td><td bgcolor="#ffaf60" width="60">&nbsp;</td><td width="50">#ffaf60<br/>(255,175,96)</td><td bgcolor="#ff8f59" width="60">&nbsp;</td><td width="50">#ff8f59<br/>(255,143,89)</td></tr><tr><td bgcolor="#c2ff68" width="60">&nbsp;</td><td width="50">#c2ff68<br/>(194,255,104)</td><td bgcolor="#ffff6f" width="60">&nbsp;</td><td width="50">#ffff6f<br/>(255,255,111)</td><td bgcolor="#ffe153" width="60">&nbsp;</td><td width="50">#ffe153<br/>(255,225,83)</td><td bgcolor="#ffbb77" width="60">&nbsp;</td><td width="50">#ffbb77<br/>(255,187,119)</td><td bgcolor="#ff9d6f" width="60">&nbsp;</td><td width="50">#ff9d6f<br/>(255,157,111)</td></tr><tr><td bgcolor="#ccff80" width="60">&nbsp;</td><td width="50">#ccff80<br/>(204,255,128)</td><td bgcolor="#ffff93" width="60">&nbsp;</td><td width="50">#ffff93<br/>(255,255,147)</td><td bgcolor="#ffe66f" width="60">&nbsp;</td><td width="50">#ffe66f<br/>(255,230,111)</td><td bgcolor="#ffc78e" width="60">&nbsp;</td><td width="50">#ffc78e<br/>(255,199,142)</td><td bgcolor="#ffad86" width="60">&nbsp;</td><td width="50">#ffad86<br/>(255,173,134)</td></tr><tr><td bgcolor="#d3ff93" width="60">&nbsp;</td><td width="50">#d3ff93<br/>(211,255,147)</td><td bgcolor="#ffffaa" width="60">&nbsp;</td><td width="50">#ffffaa<br/>(255,255,170)</td><td bgcolor="#ffed97" width="60">&nbsp;</td><td width="50">#ffed97<br/>(255,237,151)</td><td bgcolor="#ffd1a4" width="60">&nbsp;</td><td width="50">#ffd1a4<br/>(255,209,164)</td><td bgcolor="#ffbd9d" width="60">&nbsp;</td><td width="50">#ffbd9d<br/>(255,189,157)</td></tr><tr><td bgcolor="#deffac" width="60">&nbsp;</td><td width="50">#deffac<br/>(222,255,172)</td><td bgcolor="#ffffb9" width="60">&nbsp;</td><td width="50">#ffffb9<br/>(255,255,185)</td><td bgcolor="#fff0ac" width="60">&nbsp;</td><td width="50">#fff0ac<br/>(255,240,172)</td><td bgcolor="#ffdcb9" width="60">&nbsp;</td><td width="50">#ffdcb9<br/>(255,220,185)</td><td bgcolor="#ffcbb3" width="60">&nbsp;</td><td width="50">#ffcbb3<br/>(255,203,179)</td></tr><tr><td bgcolor="#e8ffc4" width="60">&nbsp;</td><td width="50">#e8ffc4<br/>(232,255,196)</td><td bgcolor="#ffffce" width="60">&nbsp;</td><td width="50">#ffffce<br/>(255,255,206)</td><td bgcolor="#fff4c1" width="60">&nbsp;</td><td width="50">#fff4c1<br/>(255,244,193)</td><td bgcolor="#ffe4ca" width="60">&nbsp;</td><td width="50">#ffe4ca<br/>(255,228,202)</td><td bgcolor="#ffdac8" width="60">&nbsp;</td><td width="50">#ffdac8<br/>(255,218,200)</td></tr><tr><td bgcolor="#efffd7" width="60">&nbsp;</td><td width="50">#efffd7<br/>(239,255,215)</td><td bgcolor="#ffffdf" width="60">&nbsp;</td><td width="50">#ffffdf<br/>(255,255,223)</td><td bgcolor="#fff8d7" width="60">&nbsp;</td><td width="50">#fff8d7<br/>(255,248,215)</td><td bgcolor="#ffeedd" width="60">&nbsp;</td><td width="50">#ffeedd<br/>(255,238,221)</td><td bgcolor="#ffe6d9" width="60">&nbsp;</td><td width="50">#ffe6d9<br/>(255,230,217)</td></tr><tr><td bgcolor="#f5ffe8" width="60">&nbsp;</td><td width="50">#f5ffe8<br/>(245,255,232)</td><td bgcolor="#fffff4" width="60">&nbsp;</td><td width="50">#fffff4<br/>(255,255,244)</td><td bgcolor="#fffcec" width="60">&nbsp;</td><td width="50">#fffcec<br/>(255,252,236)</td><td bgcolor="#fffaf4" width="60">&nbsp;</td><td width="50">#fffaf4<br/>(255,250,244)</td><td bgcolor="#fff3ee" width="60">&nbsp;</td><td width="50">#fff3ee<br/>(255,243,238)</td></tr><tr><td bgcolor="#613030" width="60">&nbsp;</td><td width="50">#613030<br/>(97,48,48)</td><td bgcolor="#616130" width="60">&nbsp;</td><td width="50">#616130<br/>(97,97,48)</td><td bgcolor="#336666" width="60">&nbsp;</td><td width="50">#336666<br/>(51,102,102)</td><td bgcolor="#484891" width="60">&nbsp;</td><td width="50">#484891<br/>(72,72,145)</td><td bgcolor="#6c3365" width="60">&nbsp;</td><td width="50">#6c3365<br/>(108,51,101)</td></tr><tr><td bgcolor="#743a3a" width="60">&nbsp;</td><td width="50">#743a3a<br/>(116,58,58)</td><td bgcolor="#707038" width="60">&nbsp;</td><td width="50">#707038<br/>(112,112,56)</td><td bgcolor="#3d7878" width="60">&nbsp;</td><td width="50">#3d7878<br/>(61,120,120)</td><td bgcolor="#5151a2" width="60">&nbsp;</td><td width="50">#5151a2<br/>(81,81,162)</td><td bgcolor="#7e3d76" width="60">&nbsp;</td><td width="50">#7e3d76<br/>(126,61,118)</td></tr><tr><td bgcolor="#804040" width="60">&nbsp;</td><td width="50">#804040<br/>(128,64,64)</td><td bgcolor="#808040" width="60">&nbsp;</td><td width="50">#808040<br/>(128,128,64)</td><td bgcolor="#408080" width="60">&nbsp;</td><td width="50">#408080<br/>(64,128,128)</td><td bgcolor="#5a5aad" width="60">&nbsp;</td><td width="50">#5a5aad<br/>(90,90,173)</td><td bgcolor="#8f4586" width="60">&nbsp;</td><td width="50">#8f4586<br/>(143,69,134)</td></tr><tr><td bgcolor="#984b4b" width="60">&nbsp;</td><td width="50">#984b4b<br/>(152,75,75)</td><td bgcolor="#949449" width="60">&nbsp;</td><td width="50">#949449<br/>(148,148,73)</td><td bgcolor="#4f9d9d" width="60">&nbsp;</td><td width="50">#4f9d9d<br/>(79,157,157)</td><td bgcolor="#7373b9" width="60">&nbsp;</td><td width="50">#7373b9<br/>(115,115,185)</td><td bgcolor="#9f4d95" width="60">&nbsp;</td><td width="50">#9f4d95<br/>(159,77,149)</td></tr><tr><td bgcolor="#ad5a5a" width="60">&nbsp;</td><td width="50">#ad5a5a<br/>(173,90,90)</td><td bgcolor="#a5a552" width="60">&nbsp;</td><td width="50">#a5a552<br/>(165,165,82)</td><td bgcolor="#5cadad" width="60">&nbsp;</td><td width="50">#5cadad<br/>(92,173,173)</td><td bgcolor="#8080c0" width="60">&nbsp;</td><td width="50">#8080c0<br/>(128,128,192)</td><td bgcolor="#ae57a4" width="60">&nbsp;</td><td width="50">#ae57a4<br/>(174,87,164)</td></tr><tr><td bgcolor="#b87070" width="60">&nbsp;</td><td width="50">#b87070<br/>(184,112,112)</td><td bgcolor="#afaf61" width="60">&nbsp;</td><td width="50">#afaf61<br/>(175,175,97)</td><td bgcolor="#6fb7b7" width="60">&nbsp;</td><td width="50">#6fb7b7<br/>(111,183,183)</td><td bgcolor="#9999cc" width="60">&nbsp;</td><td width="50">#9999cc<br/>(153,153,204)</td><td bgcolor="#b766ad" width="60">&nbsp;</td><td width="50">#b766ad<br/>(183,102,173)</td></tr><tr><td bgcolor="#c48888" width="60">&nbsp;</td><td width="50">#c48888<br/>(196,136,136)</td><td bgcolor="#b9b973" width="60">&nbsp;</td><td width="50">#b9b973<br/>(185,185,115)</td><td bgcolor="#81c0c0" width="60">&nbsp;</td><td width="50">#81c0c0<br/>(129,192,192)</td><td bgcolor="#a6a6d2" width="60">&nbsp;</td><td width="50">#a6a6d2<br/>(166,166,210)</td><td bgcolor="#c07ab8" width="60">&nbsp;</td><td width="50">#c07ab8<br/>(192,122,184)</td></tr><tr><td bgcolor="#cf9e9e" width="60">&nbsp;</td><td width="50">#cf9e9e<br/>(207,158,158)</td><td bgcolor="#c2c287" width="60">&nbsp;</td><td width="50">#c2c287<br/>(194,194,135)</td><td bgcolor="#95caca" width="60">&nbsp;</td><td width="50">#95caca<br/>(149,202,202)</td><td bgcolor="#b8b8dc" width="60">&nbsp;</td><td width="50">#b8b8dc<br/>(184,184,220)</td><td bgcolor="#ca8ec2" width="60">&nbsp;</td><td width="50">#ca8ec2<br/>(202,142,194)</td></tr><tr><td bgcolor="#d9b3b3" width="60">&nbsp;</td><td width="50">#d9b3b3<br/>(217,179,179)</td><td bgcolor="#cdcd9a" width="60">&nbsp;</td><td width="50">#cdcd9a<br/>(205,205,154)</td><td bgcolor="#a3d1d1" width="60">&nbsp;</td><td width="50">#a3d1d1<br/>(163,209,209)</td><td bgcolor="#c7c7e2" width="60">&nbsp;</td><td width="50">#c7c7e2<br/>(199,199,226)</td><td bgcolor="#d2a2cc" width="60">&nbsp;</td><td width="50">#d2a2cc<br/>(210,162,204)</td></tr><tr><td bgcolor="#e1c4c4" width="60">&nbsp;</td><td width="50">#e1c4c4<br/>(225,196,196)</td><td bgcolor="#d6d6ad" width="60">&nbsp;</td><td width="50">#d6d6ad<br/>(214,214,173)</td><td bgcolor="#b3d9d9" width="60">&nbsp;</td><td width="50">#b3d9d9<br/>(179,217,217)</td><td bgcolor="#d8d8eb" width="60">&nbsp;</td><td width="50">#d8d8eb<br/>(216,216,235)</td><td bgcolor="#dab1d5" width="60">&nbsp;</td><td width="50">#dab1d5<br/>(218,177,213)</td></tr><tr><td bgcolor="#ebd6d6" width="60">&nbsp;</td><td width="50">#ebd6d6<br/>(235,214,214)</td><td bgcolor="#dedebe" width="60">&nbsp;</td><td width="50">#dedebe<br/>(222,222,190)</td><td bgcolor="#c4e1e1" width="60">&nbsp;</td><td width="50">#c4e1e1<br/>(196,225,225)</td><td bgcolor="#e6e6f2" width="60">&nbsp;</td><td width="50">#e6e6f2<br/>(230,230,242)</td><td bgcolor="#e2c2de" width="60">&nbsp;</td><td width="50">#e2c2de<br/>(226,194,222)</td></tr><tr><td bgcolor="#f2e6e6" width="60">&nbsp;</td><td width="50">#f2e6e6<br/>(242,230,230)</td><td bgcolor="#e8e8d0" width="60">&nbsp;</td><td width="50">#e8e8d0<br/>(232,232,208)</td><td bgcolor="#d1e9e9" width="60">&nbsp;</td><td width="50">#d1e9e9<br/>(209,233,233)</td><td bgcolor="#f3f3fa" width="60">&nbsp;</td><td width="50">#f3f3fa<br/>(243,243,250)</td><td bgcolor="#ebd3e8" width="60">&nbsp;</td><td width="50">#ebd3e8<br/>(235,211,232)</td></tr>

【将结果放入HTML的最终成果】

https://www.cnblogs.com/heyang78/p/3419103.html

END

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/474323.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

dynamic动态数据源编码切换数据源

系列文章目录 文章目录 系列文章目录前言 前言 前些天发现了一个巨牛的人工智能学习网站&#xff0c;通俗易懂&#xff0c;风趣幽默&#xff0c;忍不住分享一下给大家。点击跳转到网站&#xff0c;这篇文章男女通用&#xff0c;看懂了就去分享给你的码吧。 dynamic特性 支持…

D盘满了怎么清理?3种操作方法快速释放空间!

“我平常使用电脑时&#xff0c;为了不让c盘压力太大&#xff0c;会将大部分文件都保存在d盘上&#xff0c;但是我的d盘用着用着就满了&#xff0c;有什么比较简单的d盘清理方法吗&#xff1f;请大家分享一下吧&#xff01;” 在使用电脑的过程中&#xff0c;D盘作为重要的存储…

【网页实战项目设计】基于SSM的医院预约挂号系统

基于SSM的医院预约挂号系统 项目截图 开发环境与技术框架 开发语言&#xff1a;Java 框架&#xff1a;ssm 技术&#xff1a;JSP JDK版本&#xff1a;JDK1.8 服务器&#xff1a;tomcat7 数据库&#xff1a;mysql 5.7&#xff08;一定要5.7版本&#xff09; 数据库工具&a…

数字乡村发展策略:科技引领农村实现跨越式发展

随着信息技术的迅猛发展和数字经济的崛起&#xff0c;数字乡村发展策略已经成为引领农村实现跨越式发展的重要手段。科技的力量正在深刻改变着传统农业的生产方式、农村的社会结构以及农民的生活方式&#xff0c;为农村经济发展注入了新的活力和动力。本文将从数字乡村的内涵、…

【机器学习】基于树种算法优化的BP神经网络分类预测(TSA-BP)

目录 1.原理与思路2.设计与实现3.结果预测4.代码获取 1.原理与思路 【智能算法应用】智能算法优化BP神经网络思路【智能算法】树种优化算法&#xff08;TSA&#xff09;原理及实现 2.设计与实现 数据集&#xff1a; 多输入多输出&#xff1a;样本特征24&#xff0c;标签类别…

C语言项目:数组与函数实践:扫雷游戏

目录 目录&#xff1a; 1.扫雷游戏分析与设计 1.1扫雷游戏的功能说明&#xff1a; 1.1.1使用控制台实现经典扫雷的游戏 1.1.2游戏可以通过菜单实现继续玩或者退出游戏 1.1.3扫雷棋盘是9*9的格子 1.1.4默认随机布置10个雷 1.1.5 可以排查雷 2.扫雷游戏的代码实现 1.遇到的问题…

蓝桥杯练习题总结(二)dfs题、飞机降落、全球变暖

一、飞机降落 问题描述&#xff1a; N架飞机准备降落到某个只有一条跑道的机场。其中第 i 架飞机在 时刻到达机场上空&#xff0c;到达时它的剩余油料还可以继续盘旋 个单位时间&#xff0c;即它最早可以于 1, 时刻开始降落&#xff0c;最晚可以于时刻开始降落。降落过程需要个…

【TB作品】MSP430,单片机,Proteus仿真,数字音乐盒,蜂鸣器音乐仿真

文章目录 题目要求如何根据简谱编曲仿真图代码介绍宏定义部分全局变量部分LCD 控制函数按键检测和处理函数蜂鸣器控制函数主函数部分 获取代码和仿真 题目要求 86 数字音乐盒的制作 1 设计要求 制作一个数字音乐盒,盒内存有3首乐曲,每首不少于30s。采用LCD显示乐曲信息, 开机时…

Word2vec学习笔记

&#xff08;1&#xff09;NNLM模型&#xff08;神经网络语言模型&#xff09; 语言模型是一个单纯的、统一的、抽象的形式系统&#xff0c;语言客观事实经过语言模型的描述&#xff0c;比较适合于电子计算机进行自动处理&#xff0c;因而语言模型对于自然语言的信息处理具有重…

TnT-LLM: Text Mining at Scale with Large Language Models

TnT-LLM: Text Mining at Scale with Large Language Models 相关链接&#xff1a;arxiv 关键字&#xff1a;Large Language Models (LLMs)、Text Mining、Label Taxonomy、Text Classification、Prompt-based Interface 摘要 文本挖掘是将非结构化文本转换为结构化和有意义的…

分布式锁中的王者方案 - Redission

文章目录 5.1 分布式锁-redission功能介绍5.2 分布式锁-Redission快速入门5.3 分布式锁-redission可重入锁原理5.4 分布式锁-redission锁重试和WatchDog机制5.5 分布式锁-redission锁的MutiLock原理 5.1 分布式锁-redission功能介绍 基于setnx实现的分布式锁存在下面的问题&am…

JVM垃圾收集器你会选择吗?

目录 一、Serial收集器 二、ParNew收集器 三、Paralle Scavenge 四、Serial Old 五、Parallel Old 六、CMS收集器 6.1 CMS对处理器资源非常敏感 6.2 CMS容易出现浮动垃圾 6.3 产生内存碎片 七、G1 收集器 八、如何选择合适的垃圾收集器 JVM 垃圾收集器是Java虚…

CSS3新属性(学习笔记)

一、. 圆角 border-radius:; 可以取1-4个值&#xff08;规则同margin&#xff09; 可以取px和% 一般用像素&#xff0c;画圆的时候用百分比&#xff1a;border-radius:50%; <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8&q…

Axure RP 9 for Mac中文激活版:原型设计工具

Axure RP 9 for Mac是一款值得设计师信赖的原型设计工具。它以其卓越的性能和稳定的运行赢得了广大用户的赞誉。 软件下载&#xff1a;Axure RP 9 for Mac中文激活版下载 在Axure RP 9中&#xff0c;您可以尽情发挥自己的设计才华&#xff0c;创造出独一无二的原型作品。无论是…

MySQL5.6.11安装步骤(Windows7 64位)

MySQL5.6.11安装步骤&#xff08;Windows7 64位&#xff09; 1. 下载MySQL Community Server 5.6.21&#xff0c;注意选择系统类型&#xff08;32位/64位&#xff09; 2. 解压MySQL压缩包 将以下载的MySQL压缩包解压到自定义目录下。 3. 添加环境变量 变量名&#xff1a;MYS…

重大机遇,腾讯云优惠券免费领取入口整理,千元代金券一键搞定

腾讯云代金券领取渠道有哪些&#xff1f;腾讯云官网可以领取、官方媒体账号可以领取代金券、完成任务可以领取代金券&#xff0c;大家也可以在腾讯云百科蹲守代金券&#xff0c;因为腾讯云代金券领取渠道比较分散&#xff0c;腾讯云百科txybk.com专注汇总优惠代金券领取页面&am…

蓝桥杯刷题|03普及-真题

[蓝桥杯 2017 省 B] k 倍区间 题目描述 给定一个长度为 N 的数列&#xff0c;​,,⋯&#xff0c;如果其中一段连续的子序列 ​,,⋯ (i≤j) 之和是 K 的倍数&#xff0c;我们就称这个区间 [i,j] 是 K 倍区间。 你能求出数列中总共有多少个 K 倍区间吗&#xff1f; 输入格式 …

算法设计与分析-动态规划算法的应用——沐雨先生

一、实验目的 1&#xff0e; 掌握动态规划算法的基本思想&#xff0c;包括最优子结构性质和基于表格的最优值计算方法。 2&#xff0e;熟练掌握分阶段的和递推的最优子结构分析方法。 3&#xff0e; 学会利用动态规划算法解决实际问题 。 二、实验内容 1. 问题描述 &#…

Linux之缓冲区与C库IO函数简单模拟

缓冲区 首先, 我们对缓冲区最基本的理解, 是一块内存, 用户提供的缓冲区就是用户缓冲区, C标准库提供的就是C标准库提供的缓冲区, 操作系统提供的就是操作系统缓冲区, 它们都是一块内存. 为什么要有缓冲区? 先举个生活中的例子, 我们寄快递的时候往往是去驿站寄快递, 而不是…

4 个多月的蓝猫吃什么猫粮发腮快?

亲爱的猫友们&#xff0c;你们是不是也在为蓝猫的发腮问题而苦恼呢&#xff1f;&#x1f431; 四个多月的蓝猫正处于生长发育的关键时期&#xff0c;选择合适的猫粮对于它们的健康与美丽至关重要。 &#x1f50d; 在选择猫粮时&#xff0c;我们要关注几个关键点&#xff1a;高…