Input id/name with colon
See original GitHub issueVersion of the custom_component
v6.3.2
Configuration
multiscrape:
- resource: 'https://czview.contazara.es/private/czview/meter_list.xhtml'
scan_interval: 86400
form_submit:
submit_once: True
resource: 'https://czview.contazara.es/login.xhtml'
select: "#loginForm"
input:
loginForm:username: '*******'
loginForm:password: '*************'
sensor:
- name: 'Consumo agua'
select: '.ui-datatable-data > tr > td:nth-child(4)'
value_template: '{{ value | float }}'
unit_of_measurement: 'm³'
Describe the bug
Hello! I think the problem comes from the fact that the id/name of the form in the username input and password input has colon.
Debug log
2022-07-18 11:37:50 DEBUG (MainThread) [custom_components.multiscrape.sensor] Scraper_noname_0 # Consumo agua # Setting up sensor
2022-07-18 11:37:50 DEBUG (MainThread) [custom_components.multiscrape.sensor] Scraper_noname_0 # Consumo agua # Start scraping to update sensor
2022-07-18 11:37:50 DEBUG (MainThread) [custom_components.multiscrape.scraper] Scraper_noname_0 # Consumo agua # Tag selected: None
2022-07-18 11:37:50 DEBUG (MainThread) [custom_components.multiscrape.form] Scraper_noname_0 # Exception occurred while scraping, will try to resubmit the form next interval.
2022-07-18 11:37:50 ERROR (MainThread) [custom_components.multiscrape.sensor] Scraper_noname_0 # Consumo agua # Unable to scrape data: Could not find a tag for given selector.
Consider using debug logging and log_response for further investigation.
2022-07-18 11:37:50 DEBUG (MainThread) [custom_components.multiscrape.sensor] Scraper_noname_0 # Consumo agua # On-error, set value to None
2022-07-18 11:37:50 DEBUG (MainThread) [custom_components.multiscrape.entity] Scraper_noname_0 # Consumo agua # Updated sensor and attributes, now adding to HA
Thank you for your work!
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Handling colon in element ID with jQuery
It's working fine without colon. We do not have control on ID generation as it is auto generated in Trinidad sub forms because...
Read more >Colons are used in form-tag names. | Contact Form 7
Using colons ( : ) in a form-tag name is allowed, but not recommended. While the primary role of a form-tag name is...
Read more >Handling Colon in Element ID in JQuery – Visualforce ...
I generally just use a selector like $(“input[id$=blahblah]”) because what's before the colon, and the colon itself, are generally dynamic ...
Read more >Use of colons in the name part of form-tag #879
The HTML 4.01 spec allows colons in ID and NAME tokens: ID and NAME tokens must begin with a letter ([A-Za-z]) and may...
Read more >How to target elements using ID or class containing a colon
If you have an element you need to target using an ID or class that contains a colon, for example: <div class="test:1">Content</div>.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello! I have been doing multiple tests these days and I have found that it is not really authenticating because the value of the submit button is not being sent.
You can see that this information is sent
HTML:
POST data:
Now, in HA I have installed tcpdump to capture the request made by multiscrape and it is seen that the value of the button is not sent.
Then I have created an HTML form without the button and the authentication has not worked. I have added the button to the form and the authentication has worked.
Therefore, I have changed the configuration by adding the corresponding input to the button:
And now it DOES work.
Regards!
Great, so I suppose this issue can be closed.