-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'NoneType' object has no attribute 'group' #8
Comments
What version of Beautiful Soup are you running? This has been an issue in the past
…-- Peter
On Jul 8, 2022, at 8:56 AM, nonomega ***@***.***> wrote:
Hi,
First : thanks for your code. I hope it will be usefull for monitoring my entire network.
Second :
I've got this issue : AttributeError: 'NoneType' object has no attribute 'group'
Here the trace in Debug Mode.
I already checked for a similar issue but still not working.
Could you please have a look and support me fixing this issue ?
I'm running on a pi4 with Python v3.9 / bs4 v4.11.1
Thanks in advance
nONo
python3 essstat.py 192.168.1.247 -d -u "admin" -p "________________"
admin
wap_zbpllstr4d_s
MailScanner warning: numerical links are often malicious: http://192.168.1.247
BeautifulSoup4 version: 4.11.1
<Response [200]>
True
[<script src="common.js" type="text/javascript"></script>,
<script src="ui.js" type="text/javascript"></script>, <script src="help.js" type="text/javascript"></script>, <script type="text/javavar link_info = new Array("Link Down", "Auto", "10Half", "10Full", "100H</script>]nctiondocument.location.href="PortStatisticsRpm.htm"; <script type="text/javascript"> var tmp_info = "1 5 157367329 0 64271501 0 1 0 0 0 0 0 1 5 129070523 0 18987688 0 1 0 0 0 0 0 1 5 199346829 0 108833727 7 1 0 0 0 0 0 1 5 3705591447 0 2561246977 0 1 0 9720430 0 865623 0 1 5 200550513 0 98656584 0 1 6 2236506455 0 3581761041 0 1 6 318911311 0 229635537 37 1 6 2283593391 0 2184834122 0 1 6 1437775793 0 1104743954 858875 1 5 133851404 0 24838118 0 1 0 0 0 0 0 1 0 0 0 0 0 "; var all_info = tmp_info.split(" "); var port_middle_num = 16; for (index = 0; index < port_middle_num; index++) { port_id = index + 1; port = "Port " + port_id; state = state_info[Number(all_info[index * 6])]; link_status = link_info[Number(all_info[index * 6 + 1])]; tx_good = Number(all_info[index * 6 + 2]); tx_bad = Number(all_info[index * 6 + 3]); rx_good = Number(all_info[index * 6 + 4]); rx_bad = Number(all_info[index * 6 + 5]); document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write(""); if (max_port_num > port_middle_num) { var tmp_info2 = ""; var all_info2 = tmp_info2.split(" "); for (index = port_middle_num; index < max_port_num; index++) { port_id = index + 1; port = "Port " + port_id; state = state_info[Number(all_info2[(index - port_middle_num) * 6])]; link_status = link_info[Number(all_info2[(index - port_middle_num) * 6 + 1])]; tx_good = Number(all_info2[(index - port_middle_num) * 6 + 2]); tx_bad = Number(all_info2[(index - port_middle_num) * 6 + 3]); rx_good = Number(all_info2[(index - port_middle_num) * 6 + 4]); rx_bad = Number(all_info2[(index - port_middle_num) * 6 + 5]); document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + link_status); document.write(""); document.write("" + tx_good); document.write(""); document.write("" + document.write(""); document.write("" + rx_good); document.write(""); document.write("" + document.write(""); document.write(""); </script> }
Traceback (most recent call last):
File "/home/pi/essstat/essstat.py", line 169, in
print(pattern.search(str(soup.head.find_all("script"))).group(0))
AttributeError: 'NoneType' object has no attribute 'group'
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
[ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage", "potentialAction": { ***@***.***": "ViewAction", "target": "#8", "url": "#8", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
|
Hello Peter I'm using bs4 v4.11.1 Thanks in advance for your help nONo |
Getting the same error Debug:
|
After upgrading the switch firmware to TL-SG1024DE(UN)_V6_1.0.0 Build 20230220, your script works :)
Awesome, thanks! |
Hi,
First : thanks for your code. I hope it will be usefull for monitoring my entire network.
Second :
I've got this issue : AttributeError: 'NoneType' object has no attribute 'group'
Here the trace in Debug Mode.
I already checked for a similar issue but still not working.
Could you please have a look and support me fixing this issue ?
I'm running on a pi4 with Python v3.9 / bs4 v4.11.1
Thanks in advance
nONo
python3 essstat.py 192.168.1.247 -d -u "admin" -p "________________"
<script src="ui.js" type="text/javascript"></script>, <script src="help.js" type="text/javascript"></script>, <script type="text/javavar link_info = new Array("Link Down", "Auto", "10Half", "10Full", "100H</script>]nctiondocument.location.href="PortStatisticsRpm.htm"; <script type="text/javascript"> var tmp_info = "1 5 157367329 0 64271501 0 1 0 0 0 0 0 1 5 129070523 0 18987688 0 1 0 0 0 0 0 1 5 199346829 0 108833727 7 1 0 0 0 0 0 1 5 3705591447 0 2561246977 0 1 0 9720430 0 865623 0 1 5 200550513 0 98656584 0 1 6 2236506455 0 3581761041 0 1 6 318911311 0 229635537 37 1 6 2283593391 0 2184834122 0 1 6 1437775793 0 1104743954 858875 1 5 133851404 0 24838118 0 1 0 0 0 0 0 1 0 0 0 0 0 "; var all_info = tmp_info.split(" "); var port_middle_num = 16; for (index = 0; index < port_middle_num; index++) { port_id = index + 1; port = "Port " + port_id; state = state_info[Number(all_info[index * 6])]; link_status = link_info[Number(all_info[index * 6 + 1])]; tx_good = Number(all_info[index * 6 + 2]); tx_bad = Number(all_info[index * 6 + 3]); rx_good = Number(all_info[index * 6 + 4]); rx_bad = Number(all_info[index * 6 + 5]); document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write(""); if (max_port_num > port_middle_num) { var tmp_info2 = ""; var all_info2 = tmp_info2.split(" "); for (index = port_middle_num; index < max_port_num; index++) { port_id = index + 1; port = "Port " + port_id; state = state_info[Number(all_info2[(index - port_middle_num) * 6])]; link_status = link_info[Number(all_info2[(index - port_middle_num) * 6 + 1])]; tx_good = Number(all_info2[(index - port_middle_num) * 6 + 2]); tx_bad = Number(all_info2[(index - port_middle_num) * 6 + 3]); rx_good = Number(all_info2[(index - port_middle_num) * 6 + 4]); rx_bad = Number(all_info2[(index - port_middle_num) * 6 + 5]); document.write(""); document.write("" + document.write(""); document.write("" + document.write(""); document.write("" + link_status); document.write(""); document.write("" + tx_good); document.write(""); document.write("" + document.write(""); document.write("" + rx_good); document.write(""); document.write("" + document.write(""); document.write(""); </script> }admin
wap_zbpllstr4d_s
http://192.168.1.247
BeautifulSoup4 version: 4.11.1
<Response [200]>
True
[<script src="common.js" type="text/javascript"></script>,
Traceback (most recent call last):
File "/home/pi/essstat/essstat.py", line 169, in
print(pattern.search(str(soup.head.find_all("script"))).group(0))
AttributeError: 'NoneType' object has no attribute 'group'
The text was updated successfully, but these errors were encountered: