Giter Club home page Giter Club logo

essstat's People

Contributors

jacmet avatar psmode avatar robrankin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

essstat's Issues

Don't work with TL-SG1024DE : soup.script.string is None

I try the script with a TL-SG1024DE :
python .\essstat.py -d 192.168.10.1 -p xxxx-u FredThx
FredThx
xxxx
http://192.168.10.1
<Response [200]>

<script src="common.js" type="text/javascript"></script>

None
Traceback (most recent call last):
File "essstat.py", line 149, in
print(pattern.search(soup.script.string).group(0))
TypeError: expected string or bytes-like object

soup.script.string is None!

please find attache the html request
PortStatisticsRpm.htm.txt

Clean up error handling in essstat.xlsm

The behavior of the workbook under error conditions is not what was expected. A big problem was the failure of Excel to fully reset the error condition if a 400 series status was returned by the web query. Should this occur, subsequent query operations signal VBA errors before actually doing the GET operation against eh web server.

AttributeError: 'NoneType' object has no attribute 'group'

Python 3.9.1
python-beautifulsoup4 4.9.3-3
tp-link TL-SG108E

Input:
# python essstat.py 192.168.10.4 -u"admin" -p"xxxxxxxx"

Output:

Traceback (most recent call last):
  File "/home/lucy/essstat/essstat.py", line 158, in <module>
    max_port_num = int(pattern.search(soup.script.text).group(2))
AttributeError: 'NoneType' object has no attribute 'group'

AttributeError: 'NoneType' object has no attribute 'group'

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
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'

Create a SNMP adaptor using this library?

There are lots of tools that use SNMP to query network devices. It would be lovely if this library could be used to create a persistent process that returns SNMP data for the switch.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.