Scrape help - select eth value

Hi
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:

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

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:
image

How far I’m:

sensor:
  - platform: rest
    name: Etherscan
    json_attributes:
      - balance
    resource: https://api.etherscan.io/api?module=account&action=balance&address=0x079a892628ebf28d0ed8f00151cff225a093dc63&tag=latest&apikey=MYAPIKEY

outcome:
{"status":"1","message":"OK","result":"7530395711110129542236"}

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!