吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 774|回复: 14
收起左侧

[经验求助] 怎样自动识别网站图片数据

[复制链接]
xiongshiwenxin 发表于 2024-3-25 17:22
25吾爱币
http://218.201.156.9/yc_web/

这个网站,

莒县            刘官庄        夏 庄         小 店         长 岭         寨里河        龙 山         陵阳        店子集        峤 山         桑 园         小仕阳水库         东 莞         库 山         棋 山         安 庄         果 庄         洛 河         阎庄        浮来山        青峰岭水库        谢家庄        董家庄

读取这些数据对应的数字。

求方法

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

millioxe 发表于 2024-3-25 17:51
import requests
from bs4 import BeautifulSoup
response = requests.get('http://218.201.156.9/yc_web/yc_tx_ylfbt_rz.aspx', verify=False)
get_text=[ [a.text for a in g_text_Item_one.find_all('td')] for g_text_Item_one in BeautifulSoup(response.text, 'lxml').find_all(attrs={'class': 'g_text_Item'})]
print(get_text)

Maxhaha 发表于 2024-3-25 17:54
https://www.textin.com/experience/table   把图片保存到你本地   然后打开这个网址   上传图片进行识别就行了
 楼主| xiongshiwenxin 发表于 2024-3-26 09:42
millioxe 发表于 2024-3-25 17:51
import requests
from bs4 import BeautifulSoup
response = requests.get('http://218.201.156.9/yc_web ...

怎么操作,有方法吗?
 楼主| xiongshiwenxin 发表于 2024-3-26 09:45
Maxhaha 发表于 2024-3-25 17:54
https://www.textin.com/experience/table   把图片保存到你本地   然后打开这个网址   上传图片进行识别就 ...

试了一下,上传图片不显示 数字 你可试试
引用: https://www.textin.com/experience/table   把图片保存到你本地   然后打开这个网址   上传图片进行识别就行了
Maxhaha 发表于 2024-3-26 13:05
xiongshiwenxin 发表于 2024-3-26 09:45
试了一下,上传图片不显示 数字 你可试试
引用: https://www.textin.com/experience/table   把图片保存 ...

可以啊   右边是有数字的啊   你往下滑看一看   都给你列好了
https://cdnjson.com/image/0yaUj
 楼主| xiongshiwenxin 发表于 2024-3-26 14:09
Maxhaha 发表于 2024-3-26 13:05
可以啊   右边是有数字的啊   你往下滑看一看   都给你列好了
https://cdnjson.com/image/0yaUj

我说的是 图片 比如某个点旁边的数字

莒县            刘官庄        夏 庄         小 店         长 岭         寨里河        龙 山         陵阳        店子集        峤 山         桑 园         小仕阳水库         东 莞         库 山         棋 山         安 庄         果 庄         洛 河         阎庄        浮来山        青峰岭水库        谢家庄        董家庄

旁边数字
Maxhaha 发表于 2024-3-26 14:32
本帖最后由 Maxhaha 于 2024-3-26 14:33 编辑

你这不是识别图片能解决的事。。。你这个是代码的问题   你访问这个地址可以看到   里面是有参数的   http://218.201.156.9/yc_web/yc_tx_ylfbt_rz.aspx  正则过滤一下就行了
[Python] 纯文本查看 复制代码
str = """<map name='FPMap0'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e4%b8%89%e5%ba%84&str_stcdt=00001&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("三庄","","47.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='346,390,370,406' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%97%a5%e7%85%a7%e6%b0%b4%e5%ba%93&str_stcdt=00004&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("日照水库","","53.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='428,429,476,445' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%a5%8e%e5%b1%b1&str_stcdt=00005&str_sttp=ZZ&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("奎山","","52","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='484,476,508,492' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e7%ab%96%e6%97%97&str_stcdt=00006&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("竖旗","","46","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='303,389,327,405' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%99%88%e7%96%83&str_stcdt=00007&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("陈疃","","44.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='399,384,423,400' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e8%a5%bf%e6%b9%96&str_stcdt=00008&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("西湖","","57","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='378,433,402,449' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%b7%a8%e5%b3%b0%e6%b0%b4%e5%ba%93&str_stcdt=00018&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("巨峰水库","","64.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='366,510,414,526' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%b6%9b%e9%9b%92&str_stcdt=00019&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("涛雒","","54.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='457,542,481,558' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e4%b8%a4%e5%9f%8e&str_stcdt=00020&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("两城","","45.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='559,336,583,352' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%a9%ac%e9%99%b5%e6%b0%b4%e5%ba%93&str_stcdt=00021&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("马陵水库","","41.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='471,399,519,415' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e7%a7%a6%e6%a5%bc&str_stcdt=00022&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("秦楼","","60.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='545,433,569,449' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e4%b8%9c%e6%b8%af&str_stcdt=00023&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("东港","","50","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='513,438,537,454' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%bb%84%e5%a2%a9&str_stcdt=00056&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("黄墩","","63.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='321,458,345,474' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e7%a2%91%e5%bb%93&str_stcdt=00024&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("碑廓","","59","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='351,617,375,633' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%b2%9a%e5%b1%b1&str_stcdt=00025&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("岚山","","53.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='442,654,466,670' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e8%99%8e%e5%b1%b1&str_stcdt=00026&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("虎山","","59.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='436,613,460,629' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e8%a1%97%e5%a4%b4&str_stcdt=00002&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("街头","","46.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='397,324,421,340' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%8c%91%e6%b2%9f&str_stcdt=00003&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("挑沟","","42.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='424,312,448,328' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%b2%b3%e8%a5%bf%e6%b0%b4%e5%ba%93&str_stcdt=00009&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("河西水库","","43","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='294,112,342,128' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e4%ba%94%e8%8e%b2&str_stcdt=00010&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("五莲","","48","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='363,219,387,235' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e4%ba%8e%e9%87%8c&str_stcdt=00011&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("于里","","55.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='244,187,268,203' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%ad%a6%e5%ba%84%e6%b0%b4%e5%ba%93&str_stcdt=00012&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("学庄水库","","45.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='326,253,374,269' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%88%b7%e9%83%a8%e5%b2%ad%e6%b0%b4%e5%ba%93&str_stcdt=00013&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("户部岭水库","","47.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='477,241,537,257' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%95%bf%e5%9f%8e%e5%b2%ad%e6%b0%b4%e5%ba%93&str_stcdt=00014&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("长城岭水库","","49","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='417,207,477,223' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%b0%8f%e7%8e%8b%e7%96%83%e6%b0%b4%e5%ba%93&str_stcdt=00015&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("小王疃水库","","52","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='441,164,501,180' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%ab%98%e6%b3%bd&str_stcdt=00016&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("高泽","","41","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='357,175,381,191' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%bd%ae%e6%b2%b3&str_stcdt=00017&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("潮河","","49","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='529,299,553,315' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e7%9f%b3%e4%ba%a9%e5%ad%90%e6%b0%b4%e5%ba%93&str_stcdt=00079&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("石亩子水库","","57.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='334,298,394,314' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e4%b8%ad%e6%a5%bc&str_stcdt=00055&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("中楼","","49.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='243,461,267,477' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%9d%92%e5%b3%b0%e5%b2%ad%e6%b0%b4%e5%ba%93&str_stcdt=00073&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("青峰岭水库","","48.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='164,211,224,227' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e8%b0%a2%e5%ae%b6%e5%ba%84&str_stcdt=00075&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("谢家庄","","57.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='142,107,178,123' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e4%b8%9c%e8%8e%9e&str_stcdt=00076&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("东莞","","49.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='230,68,254,84' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%b0%8f%e4%bb%95%e9%98%b3%e6%b0%b4%e5%ba%93&str_stcdt=00077&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("小仕阳水库","","43","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='241,228,301,244' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%a1%91%e5%9b%ad&str_stcdt=00078&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("桑园","","45","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='274,281,298,297' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%b3%a4%e5%b1%b1%e6%b0%b4%e5%ba%93&str_stcdt=00080&str_sttp=RR&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("峤山水库","","51.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='218,304,266,320' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e8%8e%92%e5%8e%bf&str_stcdt=00081&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("莒县","","42.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='172,335,196,351' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%ba%97%e5%ad%90%e9%9b%86&str_stcdt=00082&str_sttp=ZZ&str_snsrtp=YYNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("店子集","","41.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='208,338,244,354' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%a4%8f%e5%ba%84&str_stcdt=00088&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("夏庄","","53","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='85,452,109,468' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%9e%9c%e5%ba%84&str_stcdt=00150&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("果庄","","44","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='114,209,138,225' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e8%91%a3%e5%ae%b6%e5%ba%84&str_stcdt=00151&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("董家庄","","47","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='256,326,292,342' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%be%99%e5%b1%b1&str_stcdt=00152&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("龙山","","40","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='247,383,271,399' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%95%bf%e5%b2%ad&str_stcdt=00153&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("长岭","","54.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='162,412,186,428' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%b5%ae%e6%9d%a5%e5%b1%b1&str_stcdt=00154&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("浮来山","0.5","49.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='131,321,167,337' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%bc%80%e5%8f%91%e5%8c%ba&str_stcdt=00160&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("开发区","","51.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='530,484,566,500' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%b8%82%e6%94%bf%e5%ba%9c&str_stcdt=00161&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("市政府","","64","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='558,461,594,477' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%b1%b1%e6%b5%b7%e5%a4%a9&str_stcdt=00162&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("山海天","","51","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='567,413,603,429' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%b2%b3%e5%b1%b1&str_stcdt=00163&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("河山","","47.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='527,369,551,385' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%ab%98%e5%85%b4&str_stcdt=00098&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("高兴","","56.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='427,505,451,521' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%90%8e%e6%9d%91&str_stcdt=00097&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("后村","","55.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='412,468,436,484' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%be%99%e6%bd%ad%e6%b2%9f%e6%b0%b4%e5%ba%93&str_stcdt=00096&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("龙潭沟水库","","50.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='439,257,499,273' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%8f%a9%e5%ae%98&str_stcdt=00101&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("叩官","","51.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='514,281,538,297' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e4%b8%ad%e8%87%b3&str_stcdt=00104&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("中至","","43.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='313,203,337,219' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%ba%93%e5%b1%b1&str_stcdt=00099&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("库山","","37","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='239,121,263,137' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%a3%8b%e5%b1%b1&str_stcdt=00094&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("棋山","","40","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='178,163,202,179' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%98%8e%e5%ba%84&str_stcdt=00095&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("阎庄","","40","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='167,290,191,306' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%88%98%e5%ae%98%e5%ba%84&str_stcdt=00090&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("刘官庄","","46","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='135,383,171,399' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%b0%8f%e5%ba%97&str_stcdt=00092&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("小店","","64","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='142,452,166,468' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%af%a8%e9%87%8c%e6%b2%b3&str_stcdt=00093&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("寨里河","","46","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='226,421,262,437' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e5%ae%89%e5%ba%84&str_stcdt=00156&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("安庄","","42.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='106,180,130,196' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e6%b4%9b%e6%b2%b3&str_stcdt=00155&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("洛河","","59.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='155,227,179,243' href='javascript:void(0);'>
    <area onclick='javascript:window.open("yc_XiangQing.aspx?str_xzz=%e9%99%b5%e9%98%b3&str_stcdt=00157&str_sttp=&str_snsrtp=YNNYNNNNNN","","top=0,left=0,width=780,height=680,scroll=no,toolbar=no,menubar=no,titlebar=yes,location=no,resizable=no"); return false;' onmouseover='show_yl2("陵阳","","38.5","")' onmouseout='hidden_ylsw()' shape='rect' target='_blank' coords='192,368,216,384' href='javascript:void(0);'>
</map>"""

import re

# 使用正则表达式提取所需数据
matches = re.findall(r'show_yl2\("([^"]+)","","([^"]+)"', str)

# matches 是一个包含元组的列表,每个元组包含两个匹配项
if matches:
    for item in matches:
        zhuang, value = item
        print(f"城市名: {zhuang}", f"雨水量:{value}")
else:
    print("没有找到匹配项")


[Python] 纯文本查看 复制代码
城市名: 三庄 雨水量:47.5
城市名: 日照水库 雨水量:53.5
城市名: 奎山 雨水量:52
城市名: 竖旗 雨水量:46
城市名: 陈疃 雨水量:44.5
城市名: 西湖 雨水量:57
城市名: 巨峰水库 雨水量:64.5
城市名: 涛雒 雨水量:54.5
城市名: 两城 雨水量:45.5
城市名: 马陵水库 雨水量:41.5
城市名: 秦楼 雨水量:60.5
城市名: 东港 雨水量:50
城市名: 黄墩 雨水量:63.5
城市名: 碑廓 雨水量:59
城市名: 岚山 雨水量:53.5
城市名: 虎山 雨水量:59.5
城市名: 街头 雨水量:46.5
城市名: 挑沟 雨水量:42.5
城市名: 河西水库 雨水量:43
城市名: 五莲 雨水量:48
城市名: 于里 雨水量:55.5
城市名: 学庄水库 雨水量:45.5
城市名: 户部岭水库 雨水量:47.5
城市名: 长城岭水库 雨水量:49
城市名: 小王疃水库 雨水量:52
城市名: 高泽 雨水量:41
城市名: 潮河 雨水量:49
城市名: 石亩子水库 雨水量:57.5
城市名: 中楼 雨水量:49.5
城市名: 青峰岭水库 雨水量:48.5
城市名: 谢家庄 雨水量:57.5
城市名: 东莞 雨水量:49.5
城市名: 小仕阳水库 雨水量:43
城市名: 桑园 雨水量:45
城市名: 峤山水库 雨水量:51.5
城市名: 莒县 雨水量:42.5
城市名: 店子集 雨水量:41.5
城市名: 夏庄 雨水量:53
城市名: 果庄 雨水量:44
城市名: 董家庄 雨水量:47
城市名: 龙山 雨水量:40
城市名: 长岭 雨水量:54.5
城市名: 开发区 雨水量:51.5
城市名: 市政府 雨水量:64
城市名: 山海天 雨水量:51
城市名: 河山 雨水量:47.5
城市名: 高兴 雨水量:56.5
城市名: 后村 雨水量:55.5
城市名: 龙潭沟水库 雨水量:50.5
城市名: 叩官 雨水量:51.5
城市名: 中至 雨水量:43.5
城市名: 库山 雨水量:37
城市名: 棋山 雨水量:40
城市名: 阎庄 雨水量:40
城市名: 刘官庄 雨水量:46
城市名: 小店 雨水量:64
城市名: 寨里河 雨水量:46
城市名: 安庄 雨水量:42.5
城市名: 洛河 雨水量:59.5
城市名: 陵阳 雨水量:38.5
 楼主| xiongshiwenxin 发表于 2024-3-26 14:41
Maxhaha 发表于 2024-3-26 14:32
你这不是识别图片能解决的事。。。你这个是代码的问题   你访问这个地址可以看到   里面是有参数的   http: ...

怎样正则过滤?
Maxhaha 发表于 2024-3-26 14:44

结果上面就是匹配逻辑   这个就是正则
[Python] 纯文本查看 复制代码
matches = re.findall(r'show_yl2\("([^"]+)","","([^"]+)"', str)
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-12-12 11:49

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表