Scrape web

Hello,

I need catch info about web inside my net.
I have these html.
I interested in 238.13 and 1.22 text
I tested

  - platform: scrape
    resource: http://ip/en/phase1.html
    name: V
    username: username
    password: password
    select: '"#vrms"'

I change select with “vrms”, “rd#vrms”, ‘td:nth-of-type(1)’ These return Vrms and ‘td:nth-of-type(2)’ return Irms

Could you help me?

</head>
<body id="phase">
	<input type="hidden" id="id_fase" value="1">
	<div id="container" class="phase">
		<div id="back">
			<img src="./WiBeee_files/x-button-white.png" alt="Back" onclick="goBack()">
			<h1 id="h1Phase" class="hphase">CIRCUIT 1</h1>
		</div>
		<table>
			<tbody><tr>
				<td>Vrms</td>
				<td id="vrms">238.13 V</td>
			</tr>
			<tr>
				<td>Irms</td>
				<td id="irms">1.22 A</td>
			</tr>
			<tr>
		</tr></tbody></table>
	</div>`Preformatted text`

I guess that’s ‘td#vrms’?

Have you tried

td#vrms:nth-of-type(2)

?

Hello,
Not work.

Thank you

The selector seems to be '#vrms' when I use your provided data with the Jupyter notebook.

I test too, not work.
This is my configuration.yaml

  - platform: scrape
    resource: http://192.168.1.220/en/phase1.html
    name: V
    username: user
    password: user
    select: '#vrms'

Is correct?
Thankyou

What’s the debug output of the scrape sensor?

Is this?

I see only empty circle with out value or text.

2018-06-02 23:13:44 WARNING (MainThread) [homeassistant.setup] Setup of config is taking over 10 seconds.
2018-06-02 23:14:17 WARNING (SyncWorker_19) [netdisco.ssdp] Error fetching description at http://192.168.1.5:49155/wps_device.xml
2018-06-02 23:19:34 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.v is taking over 10 seconds
2018-06-02 23:19:34 ERROR (SyncWorker_17) [homeassistant.components.sensor.rest] Error fetching data: <PreparedRequest [GET]>
2018-06-02 23:19:34 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.v fails
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
    yield from self.async_device_update()
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/scrape.py", line 115, in update
    raw_data = BeautifulSoup(self.rest.data, 'html.parser')
  File "/usr/lib/python3.6/site-packages/bs4/__init__.py", line 192, in __init__
    elif len(markup) <= 256 and (
TypeError: object of type 'NoneType' has no len()
2018-06-02 23:20:05 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.v is taking over 10 seconds
2018-06-02 23:20:05 ERROR (SyncWorker_13) [homeassistant.components.sensor.rest] Error fetching data: <PreparedRequest [GET]>
2018-06-02 23:20:05 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.v fails
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
    yield from self.async_device_update()
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/scrape.py", line 115, in update
    raw_data = BeautifulSoup(self.rest.data, 'html.parser')
  File "/usr/lib/python3.6/site-packages/bs4/__init__.py", line 192, in __init__
    elif len(markup) <= 256 and (
TypeError: object of type 'NoneType' has no len()
2018-06-02 23:30:27 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from nmap_tracker took longer than the scheduled scan interval 0:00:12
2018-06-02 23:30:53 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from nmap_tracker took longer than the scheduled scan interval 0:00:12
2018-06-02 23:40:09 WARNING (MainThread) [haffmpeg.tools] Timeout reading image.

Now, it looks similar to https://github.com/home-assistant/home-assistant/issues/14776

Also, you don’t get the data from the source.

2018-06-02 23:19:34 ERROR (SyncWorker_17) [homeassistant.components.sensor.rest] Error fetching data: <PreparedRequest [GET]>