Does anyone know of a Beautiful Soup J-python equivalent?

Or at least something similar?

You might be able to get the previous version (beautiful soup 3.x) to work.

Thanks I’ll look into

If anyone can add…

from sgmllib import SGMLParser, SGMLParseError
import codecs
import types
import re
import sgmllib
try:
  from htmlentitydefs import name2codepoint
except ImportError:
  name2codepoint = {}

Import to project library:
BeautifulSoup3.2.2.zip (22.0 KB)

Test using one of our power monitors:

from BeautifulSoup import BeautifulSoup

url = "http://192.168.140.31/15"
soup = BeautifulSoup(system.net.httpGet(url))

t = soup.find('table')
tr = t.findAll('tr')

headers = ['meter', 'value']
data = []
for row in tr:
	td = row.findAll('td')
	if len(td) > 0:
		data.append([col.text for col in td])
		
dataOut = system.dataset.toDataSet(headers, data)

Resultant dataset:

row | meter                 value
---------------------------------
 0  | L1 Current            1229 
 1  | L2 Current            1187 
 2  | L3 Current            1164 
 3  | Avg Current           1194 
 4  | L1-N Voltage          282.0
 5  | L2-N Voltage          280.7
 6  | L3-N Voltage          277.0
 7  | Avg L-N Voltage       279.9
 8  | L1-L2 Voltage         487.0
 9  | L2-L3 Voltage         482.3
 10 | L3-L1 Voltage         485.2
 11 | Avg L-L Voltage       484.9
 12 | Frequency, last cycle 59.99
4 Likes

Hi,

How do I import the downloaded .zip file to project libary?

File
  └ Import

2 Likes

Thanks😊!