Im trying to use the scrape sensor to see if my TV is on or off, but I cant for the life of me figure out how beautifulsoup works…
This is how my TV web UI looks, theres no authentication, just browsing to the TVs IP brings this page up.
If I right click the word ON and click Copy>Selector I get this:
body > div > table:nth-child(6) > tbody > tr > td > table > tbody > tr:nth-child(5) > td.s2
But I have tried td.s2, and just .s2 but that doesnt help me, and I dont know how its supposed to be ?
I have also tried
- platform: scrape
name: Sharp State Scraped
resource: http://172.16.0.53/page_status.cgi
select: 'td:nth-of-type(17)'
because on the page there, the source is as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>PN-70TA3</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="Sat, 01 01 2000 00:00:00 GMT">
<link rel="stylesheet" href="./default.css" type="text/css">
</HEAD>
<BODY vLink=blue aLink=blue link=blue>
<DIV align="center"><TABLE>
<BR>
<TABLE cellSpacing=0 cellPadding=0 width="90%" border=0>
<TR align=right valign=middle><TD align=left>
</TD><TD align=right>PN-70TA3</TD></TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=4 width="90%" border=0 class="std">
<TR><TD rowspan=2 class="title">
INFORMATION</TD><TD class="input">HDMI2 [PC]</TD></TR>
<TR><TD class="signal">1920x1080 </TD></TR></TABLE>
<BR>
<TABLE cellSpacing=0 cellPadding=0 width=90% border=0><TBODY><TR bgColor=#7b7b7b><TD>
<TABLE cellSpacing=1 cellPadding=6 width=100% border=0><TBODY>
<TR>
<TD colspan=2 width=35% class="s1">MODEL</TD>
<TD class="s1">
PN-70TA3</TD>
</TR>
<TR>
<TD colspan=2 width=35% class="s1">S/N</TD>
<TD class="s1">
4C004015</TD>
</TR>
<TR><TD rowspan=2 width=20%% class="s1">INSTALLATION INFORMATION</TD><TD width=15%% class="s1">NAME</TD><TD class="s2"></TD></TR><TR><TD class="s1">LOCATION</TD><TD class="s2"></TD></TR>
<TR>
<TD colspan=2 width=35% class="s1">MONITOR POWER</TD>
<TD class="s2">
ON</TD>
</TR>
and so on, with it being the 13th occurrence of td…
Is anybody thats using this sensor able to point me in the right direction?
Thank you !
Full source of the page: