Retrieve epay info Balance with VBA and Excel

0 votes

The site in question got a login form before accessing data, and it don't furnish any API's. Some idea or suggestion? Here is an extract of code of the login page (http://epay.info/Login/):

<form enctype="application/x-www-form-urlencoded" class="form-signin" action="" method="post" style="margin-top: 30px;">
    <h2 class="form-signin-heading">ePay.info Login</h2>
    <div class="login-wrap">
    <div class="form-group">
        <input style="margin-right: 0px; padding-right: 0px;" name="username" id="username" value="" placeholder="Wallet addresses, Username or E-mail address" class="form-control input-lg" type="text"><img title="Lunghezza massima del campo sconosciuta" style="position: relative; left: 304px; top: -33px; z-index: 999; cursor: pointer; vertical-align: bottom; border: 0px none; width: 14px; height: 19px; display: inline;" class="ife_marker" src="chrome://informenter/skin/marker.png" id="username_ife_marker_0">
    </div>
    <div class="form-group">
        <input style="margin-right: 0px; padding-right: 0px;" name="password" id="password" value="" placeholder="Password (only if secured)" class="form-control input-lg" type="password"><img title="Lunghezza massima del campo sconosciuta" style="position: relative; left: 304px; top: -33px; z-index: 999; cursor: pointer; vertical-align: bottom; border: 0px none; width: 14px; height: 19px; display: inline;" class="ife_marker" src="chrome://informenter/skin/marker.png" id="password_ife_marker_1">
    </div>
    <div class="row">
        <button class="btn btn-lg btn-login btn-block" name="login" type="submit">Login and check stats</button>
    </div>
Sep 5, 2018 in Blockchain by slayer
• 29,350 points
864 views

1 answer to this question.

0 votes

This code should log you in, provided you enter the correct values for these two lines:

username.Value = "Test"
password.Value = "Test"

Open the VB Editor by pressing Alt+F11 and insert a new standard code module. Paste in the following code:

Option Explicit

Private Sub LoginToEpay()

    Dim IE As Object
    Dim username As Object
    Dim password As Object
    Dim objCollection As Object
    Dim i As Integer

    Set IE = CreateObject("InternetExplorer.Application")

    IE.Visible = True

    'Navigate to the website
    IE.navigate URL:="http://epay.info/Login/"

    'Wait for page to load
    Do While IE.Busy Or IE.readyState <> READYSTATE_COMPLETE
        Application.Wait DateAdd("s", 1, Now)
    Loop

    'Username and password elements have IDs
    Set username = IE.document.getElementById("username")
    Set password = IE.document.getElementById("password")

    'Login button doesn't have an ID so we must use name
    'This returns an array of items that have the name
    'login
    Set loginBtn = IE.document.getElementsByName("login")

    username.Value = "Test"
    password.Value = "Test"

    While i < objCollection.Length
        If objCollection(i).Type = "submit" Then objCollection(i).Click
        i = i + 1
    Wend

End Sub
answered Sep 5, 2018 by digger
• 26,740 points

Related Questions In Blockchain

0 votes
1 answer

Can we protect a Private Blockchain with a Public Blockchain and how?

I have recently reviewed Exonum framework (https://exonum.com/) ...READ MORE

answered Jun 19, 2018 in Blockchain by Perry
• 17,100 points
416 views
0 votes
1 answer

How can I retrieve to and from address in transaction directly from blockchain?

The spending conditions, i.e., who is able ...READ MORE

answered Jul 11, 2018 in Blockchain by Shashank
• 10,400 points
995 views
0 votes
1 answer

How to download the full blocks (with transactions) directly and in parallel from the connected nodes in NodesGroup?

 just got informed, that NBitcoin currently does ...READ MORE

answered Jul 31, 2018 in Blockchain by Shashank
• 10,400 points
397 views
0 votes
1 answer

what is the latest block chain development and top players with this tech, such as Digital Asset Holdings ?

The blockchain technology still has a few ...READ MORE

answered Sep 5, 2018 in Blockchain by Christine
• 15,790 points
332 views
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,450 points
1,123 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,655 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,211 views
0 votes
1 answer

Solidity difference array with and without new keyword.

Creating arrays with variable length in memory ...READ MORE

answered Aug 16, 2018 in Blockchain by digger
• 26,740 points
1,393 views
0 votes
1 answer

How can I take the required info and send it to a div in the html page?

window.onload=function(){ var anima = document.getElementById("crypto"); var ret = document.getElementById("btn"); ret.addEventListener("click",function(){ var ...READ MORE

answered Sep 6, 2018 in Blockchain by digger
• 26,740 points
554 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP