Scrape help - select eth value

I’m trying to do make this work the whole day without luck, so I hope someone can help me a bit with the following scrape. It is about the “Eth Value” on the following page, so “$231.99”

this value is displayed on the html source page and I don’t see any cookie notification so ready to scrape I guess.

The source looks like:

<h4 class="text-cap mb-1">
Eth Value
$231.99 <span class='small' style='position:relative;top:-1px'>(@ $1,847.98/ETH)</span>

but the problem is that there are multiple classes with the same name.
Dev view:

What I’ve tried so far:

select: ".Eth Value"
select: "div[text-cap mb-1='Eth Value']"
select: "text-cap mb-1='Eth Value']"

and more of these combinations without luck unfortunately.

Any reason why you donot want to use their API? the free version is not bad at all so it seems
EDIT: then you get a json so you can use the REST integration that HA provides

o I didn’t know there was an etherscan integration…thank you!

Wel… not a specific one, you can use the rest integration, using the url that you create with etherscan API
That will kick back a json and that you can use
… let me know if you need a bit of hand (then let me know too what data you are after)

o I saw Etherscan on the integation page but does not work it seems.
so I’m trying to create a rest sensor. I will let you know how it proceeds :slight_smile:

If you don’t mind can you share an example how to get the $ value? Preferely also the token holding value:

How far I’m:

  - platform: rest
    name: Etherscan
      - balance


but the result is the ETH balance. I’m looking for the ETH value ($) and the $ value below (token holdings)

hm when I look at the API documentation, I don’t think it has a $ balance request available :frowning:

Just spent 15min browsing/trying API and I can’t get that value…odd
The balance I do get using above (you used a different address btw)
A few times before I tried scrap and always miserably failed, not trying again… let’s hope someone else can hekp you

thanks anyway for thinking along! I think scrape is the best option. @Troon if you have time and want to think along with the scrape above I really appreciate it. if it doesn’t work out, that’s no problem.

Ah, I now discovered you earlier raised a similar topic.
Well, helped by the comments of Troon… use this

#ContentPlaceHolder1_divSummary > div.row.g-3.mb-4 > div:nth-child(1) > div > div > div:nth-child(3)

This gives you the value

Eth Value $229.93 (@ $1,841.03/ETH)

with the template

{{ value.split('(')[0].split('$')[1] }}

you get: 229.93

EDIT: use the same header as before

1 Like

you are a life saver. thanks for your time!