Hey team!
I am trying to scrape Central north fire danger days in Australia from one of these two websites and no matter how I try select the css selector, it returns “unknown”. I can return basic values like <title> so I know it can scrape, but as soon as I get to the content I want, it fails. This is my last resort. I suspect it might be because of lazy loading or JS that isn’t visible when the scrape occurs.
Hellis81, can help me understand more how that helps me? I’ve looked through most of the JS, but I couldn’t see any obvious ways to grab what I need.
In the second example, it seems like i’s the <table> I am having trouble with… I can easily select id’s above the table, but not in it. Seems like the. #content is all from the same source of info.
have a look at the BOM integration in HACS it pulls what you need from an API I think, they have fire ratings and warnings in sensors… I have this info at the top of the first card on my dashboard, today the fire danger is high
Taking the second URL first (which does have the info in the static HTML), if you look at the HTML source, you’ll see there isn’t a <tbody> element in the table. Try removing it from your selector. The tools that work out a selector will often insert one, which is optional in the HTML spec but if you specify it in the selector and it isn’t there, it’ll fail. Best to work the selector out manually.
For the first URL, turn on the Network tab of whatever browser DevTools you’re using and hit refresh. Look for an “xhr” (XMLHttpResponse aka AJAX) request: