Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
Trying to get value determined by javascript using selenium

As title says, I am currently trying to acquire a dynamic value. I am lost as originally I was using beautiful soup and found out the value was dynamic. Here are how the values are determined

        .call({from: from})
        .then(function(res) {
            console.log("Node Price (Wei AVAX): " + res);
            const avax = Number(Web3.utils.fromWei(res, 'ether'));
            console.log("Node Price (AVAX): " + avax);
            const items = document.querySelectorAll(".node-info-price-avax");
            items.forEach(i => {
                i.innerHTML = avax.toFixed(2) + " AVAX";
            });
        })

Then here is how its displayed,

<span class="node-info-price-avax">27.88 AVAX</span>

I've been watching tutorials and reading over guides all day and can not for the love of me figure out how to acquire said value.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I found a pretty detailed video that did exactly what I was looking for. The solution was finding the data I needed and copying the xpath by using find_element, then I appened it to a list and used pandas to make it look pretty. Here is the finished code:

from selenium import webdriver
import pandas as pd

PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)

driver.get("https://playa3ull.games")

node_data = driver.find_elements_by_class_name('wpb_wrapper')

data_list = []

for data in node_data:
    node_price = data.find_element_by_xpath('//*[@id="pb-node-info-table"]/tbody/tr[6]/td[2]/span[1]').text
    nodes_sold = data.find_element_by_xpath('//*[@id="pb-node-info-table"]/tbody/tr[3]/td[2]').text
    token_price = data.find_element_by_xpath('//*[@id="pb-node-info-table"]/tbody/tr[6]/td[2]/span[2]').text
    data_item = {
        'Node Price': node_price,
        'Nodes Sold': nodes_sold,
        'Token Price': token_price
    }
    data_list.append(data_item)

df = pd.DataFrame(data_list)
df_last = df[-1]
print(df_last)

Here is the link for a more detailed explanation: youtube.com/watch?v=lTypMlVBFM4

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!